Begin test update

This commit is contained in:
2024-04-08 00:24:46 -04:00
parent 8f0d1c64bd
commit 1a93a30b42
28 changed files with 559 additions and 78 deletions

View File

@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
import com.mattrixwv.cipherstream.monosubstitution.Caesar;
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
import lombok.extern.slf4j.Slf4j;
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
@RestController
@RequestMapping("/cipherStream/caesar")
public class CaesarCipherController{
@GetMapping
public ObjectNode getCipherInfo(){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.CAESAR_CIPHER_NAME);
log.info("Getting info for {}", CipherInfoUtil.CAESAR_CIPHER_NAME);
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.CAESAR_CIPHER_NAME, CipherInfoUtil.CAESAR_CIPHER_DESCRIPTION);
}
@GetMapping("/encode")
public ObjectNode encodeCaesar(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Caesar");
log.info("Encoding Caesar");
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.CAESAR_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.CAESAR_CIPHER_NAME);
CipherParameterUtil.verifyCaesarParams(cipherParams);
@@ -44,8 +54,8 @@ public class CaesarCipherController{
@GetMapping("/decode")
public ObjectNode decodeCaesar(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Caesar");
log.info("Decoding Caesar");
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.CAESAR_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.CAESAR_CIPHER_NAME);
CipherParameterUtil.verifyCaesarParams(cipherParams);