This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.KeyFactory; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.PrivateKey; | |
import java.security.PublicKey; | |
import java.security.Signature; | |
import java.security.spec.InvalidKeySpecException; | |
import java.security.spec.PKCS8EncodedKeySpec; | |
import java.security.spec.X509EncodedKeySpec; | |
import java.util.Base64; | |
import org.springframework.util.StringUtils; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First stage: Build UPX for ARM64 | |
FROM amd64/alpine:latest AS build | |
# Install dependencies to build UPX | |
RUN apk add --no-cache build-base git cmake | |
# Clone UPX repository and build it | |
RUN git clone https://github.com/upx/upx.git /upx \ | |
&& cd /upx \ | |
&& git submodule update --init \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Base64; | |
import java.security.spec.X509EncodedKeySpec; | |
import java.security.KeyFactory; | |
import java.security.PublicKey; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.OAEPParameterSpec; | |
import javax.crypto.spec.PSource; | |
import java.security.spec.MGF1ParameterSpec; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cms.alto.cmsapi.dto.exception; | |
public class CardEncryptorException extends Exception { | |
public CardEncryptorException(Throwable e) { | |
super(e); | |
} | |
public CardEncryptorException(String message) { | |
super(message); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Slf4j | |
@ExtendWith(MockitoExtension.class) | |
public class CallablePublisherTest { | |
private String data() { | |
log.info("is it executed?"); | |
return "data"; | |
} | |
@Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No | Triggering Event | Services | Success Event | Failed Event | |
---|---|---|---|---|---|
1 | - | Order Microservices | Create order | - | |
2 | Create order | Inventory Microservices | Decrease stock | Decrease stock failed | |
2a | Decrease stock failed | Order Microservices | - | - | |
3 | Decrease stock | Payment Microservices | Debit balance | Credit balance | |
3a | Credit balance | Inventory Microservices | - | - | |
4 | Debit balance | Order Microservices | - | - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class JaversAuditorProvider implements AuthorProvider { | |
@Autowired | |
private Tracer tracer; | |
private static final String X_AUDITOR_HEADER = "x-auditor"; | |
@Override | |
public String provide() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JavaExample { | |
public static Integer calculate(Integer value) throws Exception { | |
return value / value; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CollectionTest { | |
@Test | |
public void immutability() { | |
List<String> wordList = Arrays.asList("first", "second", "third"); | |
List<String> immutableList = Collections.unmodifiableList(wordList); | |
immutableList.add("error?"); | |
} | |
@Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MonadEither { | |
private Either<String, Integer> computeWithEither(int score) { | |
if (score > 80) { | |
return Either.right(score); | |
} | |
return Either.left("Failed"); | |
} | |
@Test | |
public void eitherExample() { |
NewerOlder