diff --git a/src/main/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspect.java b/src/main/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspect.java index 9d7c74f..52c6f8f 100644 --- a/src/main/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspect.java +++ b/src/main/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspect.java @@ -4,6 +4,7 @@ package com.mattrixwv.cipherstream.aspect; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; +import org.slf4j.MDC; import org.springframework.context.annotation.Configuration; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -35,7 +36,17 @@ public class CipherStreamLoggingAspect{ @AfterReturning(pointcut = "cipherMethod() && postFunction()", returning = "returnedJson") public void getCipherInfo(ObjectNode returnedJson){ + //Extract JSON to MDC + returnedJson.fields().forEachRemaining(entry -> { + if(entry.getValue().isTextual()){ + MDC.put(entry.getKey(), entry.getValue().asText()); + } + else{ + MDC.put(entry.getKey(), entry.getValue().toString()); + } + }); + //Print a log - log.info("CipherStream log {}", returnedJson); + log.info("CipherStream log"); } } diff --git a/src/main/resources/log4j2-spring.xml b/src/main/resources/log4j2-spring.xml index 20f1de8..fc03b92 100644 --- a/src/main/resources/log4j2-spring.xml +++ b/src/main/resources/log4j2-spring.xml @@ -10,6 +10,8 @@ + + @@ -17,6 +19,16 @@ + + + + + + + + + + diff --git a/src/main/resources/template.json b/src/main/resources/template.json index 74aea5c..f46cb91 100644 --- a/src/main/resources/template.json +++ b/src/main/resources/template.json @@ -2,7 +2,7 @@ "timestamp": { "$resolver": "timestamp", "pattern": { - "format": "yyy-MM-dd HH:mm:ss.SSSZ" + "format": "yyyy-MM-dd HH:mm:ss.SSSZ" } }, "level": { @@ -13,6 +13,15 @@ "$resolver": "mdc", "key": "requestId" }, + "logger": { + "$resolver": "logger", + "field": "name" + }, + "mdc":{ + "$resolver": "mdc", + "flatten": false, + "stringified": false + }, "message": { "$resolver": "message", "stringified": true diff --git a/src/test/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspectTest.java b/src/test/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspectTest.java index aaede93..bfd837c 100644 --- a/src/test/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspectTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/aspect/CipherStreamLoggingAspectTest.java @@ -42,7 +42,7 @@ public class CipherStreamLoggingAspectTest{ jsonNode.put("something", "Something Important"); - aspect.getCipherInfo(null); + aspect.getCipherInfo(jsonNode); assertNotNull(aspect); diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/CipherStreamControllerIntegrationTestBase.java b/src/test/java/com/mattrixwv/cipherstream/controller/CipherStreamControllerIntegrationTestBase.java index 93fe2a0..ffc4723 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/CipherStreamControllerIntegrationTestBase.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/CipherStreamControllerIntegrationTestBase.java @@ -53,4 +53,21 @@ public class CipherStreamControllerIntegrationTestBase{ verify(mdc, times(1)).put("url", url); verify(mdc, times(1)).clear(); } + + protected void verifyAspectLogging(ObjectNode jsonNode){ + //Verify the MDC + jsonNode.fields().forEachRemaining(entry -> { + if(entry.getValue().isTextual()){ + verify(mdc, times(1)).put(entry.getKey(), entry.getValue().asText()); + } + else{ + verify(mdc, times(1)).put(entry.getKey(), entry.getValue().toString()); + } + }); + verifyNoMoreInteractions(mdc); + + //Verify the logger + verify(aspectLogger, times(1)).info("CipherStream log"); + verifyNoMoreInteractions(aspectLogger); + } } diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgvxCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgvxCipherControllerIntegrationTest.java index 70e7780..cb525d0 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgvxCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgvxCipherControllerIntegrationTest.java @@ -116,7 +116,7 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle verify(adfgvxLogger, times(1)).info("Encoding {}", adfgvxName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -156,7 +156,7 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle verify(adfgvxLogger, times(1)).info("Decoding {}", adfgvxName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgxCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgxCipherControllerIntegrationTest.java index 44d6b70..0aadef2 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgxCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/combination/AdfgxCipherControllerIntegrationTest.java @@ -116,7 +116,7 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController verify(adfgxLogger, times(1)).info("Encoding {}", adfgxName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -156,7 +156,7 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController verify(adfgxLogger, times(1)).info("Decoding {}", adfgxName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AffineCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AffineCipherControllerIntegrationTest.java index de33e6e..9283168 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AffineCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AffineCipherControllerIntegrationTest.java @@ -116,7 +116,7 @@ public class AffineCipherControllerIntegrationTest extends CipherStreamControlle verify(affineLogger, times(1)).info("Encoding {}", affineName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, affineName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -156,7 +156,7 @@ public class AffineCipherControllerIntegrationTest extends CipherStreamControlle verify(affineLogger, times(1)).info("Decoding {}", affineName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, affineName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AtbashCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AtbashCipherControllerIntegrationTest.java index b7e4a13..03232eb 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AtbashCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AtbashCipherControllerIntegrationTest.java @@ -110,7 +110,7 @@ public class AtbashCipherControllerIntegrationTest extends CipherStreamControlle verify(atbashLogger, times(1)).info("Encoding {}", atbashName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, atbashName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -150,7 +150,7 @@ public class AtbashCipherControllerIntegrationTest extends CipherStreamControlle verify(atbashLogger, times(1)).info("Decoding {}", atbashName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, atbashName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AutokeyCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AutokeyCipherControllerIntegrationTest.java index 8268b2a..2ecefaa 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AutokeyCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/AutokeyCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class AutokeyCipherControllerIntegrationTest extends CipherStreamControll verify(autokeyLogger, times(1)).info("Encoding {}", autokeyName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, autokeyName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class AutokeyCipherControllerIntegrationTest extends CipherStreamControll verify(autokeyLogger, times(1)).info("Decoding {}", autokeyName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, autokeyName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaconianCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaconianCipherControllerIntegrationTest.java index 339bada..9ffdfa5 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaconianCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaconianCipherControllerIntegrationTest.java @@ -110,7 +110,7 @@ public class BaconianCipherControllerIntegrationTest extends CipherStreamControl verify(baconianLogger, times(1)).info("Encoding {}", baconianName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -150,7 +150,7 @@ public class BaconianCipherControllerIntegrationTest extends CipherStreamControl verify(baconianLogger, times(1)).info("Decoding {}", baconianName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaseXCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaseXCipherControllerIntegrationTest.java index 3f736b4..30944be 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaseXCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BaseXCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class BaseXCipherControllerIntegrationTest extends CipherStreamController verify(baseXLogger, times(1)).info("Encoding {}", baseXName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baseXName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class BaseXCipherControllerIntegrationTest extends CipherStreamController verify(baseXLogger, times(1)).info("Decoding {}", baseXName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baseXName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BeaufortCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BeaufortCipherControllerIntegrationTest.java index 6be6ae6..91299ea 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BeaufortCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/BeaufortCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class BeaufortCipherControllerIntegrationTest extends CipherStreamControl verify(beaufortLogger, times(1)).info("Encoding {}", beaufortName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, beaufortName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class BeaufortCipherControllerIntegrationTest extends CipherStreamControl verify(beaufortLogger, times(1)).info("Decoding {}", beaufortName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, beaufortName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/CaesarCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/CaesarCipherControllerIntegrationTest.java index 5848d7f..927427a 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/CaesarCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/CaesarCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class CaesarCipherControllerIntegrationTest extends CipherStreamControlle verify(caesarLogger, times(1)).info("Encoding {}", caesarName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class CaesarCipherControllerIntegrationTest extends CipherStreamControlle verify(caesarLogger, times(1)).info("Decoding {}", caesarName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/OneTimePadCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/OneTimePadCipherControllerIntegrationTest.java index cb500cc..52353db 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/OneTimePadCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/OneTimePadCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class OneTimePadCipherControllerIntegrationTest extends CipherStreamContr verify(oneTimePadLogger, times(1)).info("Encoding {}", oneTimePadName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, oneTimePadName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class OneTimePadCipherControllerIntegrationTest extends CipherStreamContr verify(oneTimePadLogger, times(1)).info("Decoding {}", oneTimePadName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, oneTimePadName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/PortaCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/PortaCipherControllerIntegrationTest.java index 4243695..8cd4c16 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/PortaCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/PortaCipherControllerIntegrationTest.java @@ -118,7 +118,7 @@ public class PortaCipherControllerIntegrationTest extends CipherStreamController verify(portaLogger, times(1)).info("Encoding {}", portaName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, portaName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -162,7 +162,7 @@ public class PortaCipherControllerIntegrationTest extends CipherStreamController verify(portaLogger, times(1)).info("Decoding {}", portaName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, portaName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/SubstitutionCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/SubstitutionCipherControllerIntegrationTest.java index 00e2282..9ec0616 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/SubstitutionCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/SubstitutionCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class SubstitutionCipherControllerIntegrationTest extends CipherStreamCon verify(substitutionLogger, times(1)).info("Encoding {}", substitutionName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, substitutionName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class SubstitutionCipherControllerIntegrationTest extends CipherStreamCon verify(substitutionLogger, times(1)).info("Decoding {}", substitutionName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, substitutionName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/VigenereCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/VigenereCipherControllerIntegrationTest.java index 377f30a..04235ea 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/VigenereCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/monosubstitution/VigenereCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class VigenereCipherControllerIntegrationTest extends CipherStreamControl verify(vigenereLogger, times(1)).info("Encoding {}", vigenereName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class VigenereCipherControllerIntegrationTest extends CipherStreamControl verify(vigenereLogger, times(1)).info("Decoding {}", vigenereName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/BifidCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/BifidCipherControllerIntegrationTest.java index acf8c66..a3fe98b 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/BifidCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/BifidCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class BifidCipherControllerIntegrationTest extends CipherStreamController verify(bifidLogger, times(1)).info("Encoding {}", bifidName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, bifidName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class BifidCipherControllerIntegrationTest extends CipherStreamController verify(bifidLogger, times(1)).info("Decoding {}", bifidName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, bifidName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/ColumnarCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/ColumnarCipherControllerIntegrationTest.java index 38e7448..8885d22 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/ColumnarCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/ColumnarCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class ColumnarCipherControllerIntegrationTest extends CipherStreamControl verify(columnarLogger, times(1)).info("Encoding {}", columnarName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, columnarName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class ColumnarCipherControllerIntegrationTest extends CipherStreamControl verify(columnarLogger, times(1)).info("Decoding {}", columnarName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, columnarName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/HillCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/HillCipherControllerIntegrationTest.java index 3e7e19e..ebd4cee 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/HillCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/HillCipherControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class HillCipherControllerIntegrationTest extends CipherStreamControllerI verify(hillLogger, times(1)).info("Encoding {}", hillName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class HillCipherControllerIntegrationTest extends CipherStreamControllerI verify(hillLogger, times(1)).info("Decoding {}", hillName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/MorseCodeControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/MorseCodeControllerIntegrationTest.java index f3eefb1..aed6c97 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/MorseCodeControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/MorseCodeControllerIntegrationTest.java @@ -103,7 +103,7 @@ public class MorseCodeControllerIntegrationTest extends CipherStreamControllerIn verify(morseLogger, times(1)).info("Encoding {}", morseName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, morseName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -143,7 +143,7 @@ public class MorseCodeControllerIntegrationTest extends CipherStreamControllerIn verify(morseLogger, times(1)).info("Decoding {}", morseName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, morseName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PlayfairCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PlayfairCipherControllerIntegrationTest.java index b70618d..921b8d4 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PlayfairCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PlayfairCipherControllerIntegrationTest.java @@ -114,7 +114,7 @@ public class PlayfairCipherControllerIntegrationTest extends CipherStreamControl verify(playfairLogger, times(1)).info("Encoding {}", playfairName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, playfairName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -154,7 +154,7 @@ public class PlayfairCipherControllerIntegrationTest extends CipherStreamControl verify(playfairLogger, times(1)).info("Decoding {}", playfairName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, playfairName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PolybiusSquareControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PolybiusSquareControllerIntegrationTest.java index f6cd07a..0a2ee7a 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PolybiusSquareControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/PolybiusSquareControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class PolybiusSquareControllerIntegrationTest extends CipherStreamControl verify(polybiusLogger, times(1)).info("Encoding {}", polybiusName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, polybiusName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class PolybiusSquareControllerIntegrationTest extends CipherStreamControl verify(polybiusLogger, times(1)).info("Decoding {}", polybiusName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, polybiusName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/RailFenceControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/RailFenceControllerIntegrationTest.java index 31e8481..6a32efa 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/RailFenceControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/RailFenceControllerIntegrationTest.java @@ -113,7 +113,7 @@ public class RailFenceControllerIntegrationTest extends CipherStreamControllerIn verify(railFenceLogger, times(1)).info("Encoding {}", railFenceName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, railFenceName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -153,7 +153,7 @@ public class RailFenceControllerIntegrationTest extends CipherStreamControllerIn verify(railFenceLogger, times(1)).info("Decoding {}", railFenceName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, railFenceName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test diff --git a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/TrifidCipherControllerIntegrationTest.java b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/TrifidCipherControllerIntegrationTest.java index e033cb8..7372111 100644 --- a/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/TrifidCipherControllerIntegrationTest.java +++ b/src/test/java/com/mattrixwv/cipherstream/controller/polysubstitution/TrifidCipherControllerIntegrationTest.java @@ -119,7 +119,7 @@ public class TrifidCipherControllerIntegrationTest extends CipherStreamControlle verify(trifidLogger, times(1)).info("Encoding {}", trifidName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, trifidName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode); + verifyAspectLogging(decodedNode); } @Test @@ -159,7 +159,7 @@ public class TrifidCipherControllerIntegrationTest extends CipherStreamControlle verify(trifidLogger, times(1)).info("Decoding {}", trifidName); verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, trifidName); //Cipher Aspect - verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode); + verifyAspectLogging(encodedNode); } @Test