24 Commits
1.0 ... v1.1.6

Author SHA1 Message Date
917246f877 Update version number 2025-01-11 12:25:24 -05:00
a53c765c9c Update dependencies and plugins 2025-01-11 12:22:12 -05:00
0be6b6bcc1 Update with nvd api key 2024-08-16 23:34:39 -04:00
9a4b3a19f8 Update snapshot version 2024-08-12 21:31:55 -04:00
ac492307ab Updated libraries 2024-08-12 20:46:16 -04:00
b1ffde262a Updated snapshot version 2024-08-05 20:03:29 -04:00
af302d49db Update dependencies 2024-08-05 20:01:41 -04:00
b0efac01e0 Update snapshot version 2024-07-07 19:50:26 -04:00
2879310392 Update dependencies 2024-07-07 19:45:33 -04:00
3eb3161eb0 Update SNAPSHOT version 2024-05-02 20:34:38 -04:00
8e5846647b Update version number 2024-05-02 14:31:49 -04:00
Matthew Ellison
9b5965e4b5 Update typos in cipher descriptions 2024-05-01 16:18:00 -04:00
9d00124062 Updated snapshot version 2024-04-28 23:40:38 -04:00
eda3e70e73 Update version 2024-04-28 23:38:21 -04:00
5fb237cb5c Update template to be more compatible with graylog 2024-04-28 23:38:07 -04:00
00eb61a1ea Updated SNAPSHOT version 2024-04-28 16:30:02 -04:00
10c7532878 Update version number 2024-04-28 16:28:00 -04:00
6a8b69371f Update integration tests 2024-04-28 16:25:39 -04:00
c6d98c72ef Add health check 2024-04-28 15:26:46 -04:00
cc0aa2986d Update cipher logging 2024-04-28 15:26:40 -04:00
1183cab5f1 Updated snapshot version 2024-04-27 16:25:04 -04:00
28a7a60de3 Updated version number 2024-04-27 16:23:19 -04:00
4a5a221605 Updated CORS to use a property 2024-04-27 16:23:05 -04:00
3b9a984659 Update version SNAPSHOT 2024-04-27 14:48:15 -04:00
36 changed files with 415 additions and 97 deletions

41
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.mattrixwv.cipherstream</groupId>
<artifactId>cipherstream-api</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<version>1.1.6</version>
<name>CipherStream API</name>
<url>https://api.cipherstream.mattrixwv.com</url>
@@ -26,7 +26,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.4.1</version>
</parent>
<dependencies>
@@ -56,7 +56,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.32</version>
<version>1.18.36</version>
<scope>provided</scope>
</dependency>
@@ -64,7 +64,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -73,7 +73,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-layout-template-json</artifactId>
<version>2.23.1</version>
<version>2.24.3</version>
</dependency>
<dependency>
<groupId>com.lmax</groupId>
@@ -85,14 +85,14 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.22</version>
<version>1.9.22.1</version>
</dependency>
<!--My libraries-->
<dependency>
<groupId>com.mattrixwv</groupId>
<artifactId>cipher-stream-java</artifactId>
<version>1.3.4</version>
<version>1.3.7</version>
</dependency>
<!--Tests-->
@@ -110,7 +110,7 @@
<dependency>
<groupId>org.simplify4u</groupId>
<artifactId>slf4j2-mock</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -125,7 +125,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-maven</id>
@@ -145,7 +145,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.3.2</version>
<version>3.4.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -167,7 +167,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<version>3.5.2</version>
<configuration>
<skipTests>${skip.unit.tests}</skipTests>
<excludes>
@@ -181,22 +181,22 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
<version>3.1.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<version>3.1.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.5</version>
<version>3.5.2</version>
<executions>
<execution>
<configuration>
@@ -214,17 +214,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
<version>3.21.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.5.0</version>
<version>3.8.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.16.2</version>
<version>2.18.0</version>
<configuration>
<rulesUri>file://${session.executionRootDirectory}/version-rules.xml</rulesUri>
</configuration>
@@ -233,7 +233,7 @@
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.11.0.3922</version>
<version>5.0.0.4389</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
@@ -264,7 +264,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>9.1.0</version>
<version>12.0.0</version>
<executions>
<execution>
<phase>none</phase>
@@ -278,6 +278,7 @@
<format>json</format>
<format>html</format>
</formats>
<nvdApiServerId>nvd</nvdApiServerId>
</configuration>
</plugin>
</plugins>

View File

@@ -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");
}
}

View File

@@ -21,6 +21,18 @@ import lombok.extern.slf4j.Slf4j;
public class FullFilter extends OncePerRequestFilter{
@Override
protected void doFilterInternal(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull FilterChain filterChain) throws ServletException, IOException{
if(!request.getMethod().equalsIgnoreCase("OPTIONS")){
setupMDC(request);
}
//Continue to the controller
filterChain.doFilter(request, response);
//Clear the MDC for the next request
MDC.clear();
}
private void setupMDC(HttpServletRequest request){
//Get the requestId
if(request.getHeader("X-Request-Id") != null){
MDC.put("requestId", request.getHeader("X-Request-Id"));
@@ -56,11 +68,5 @@ public class FullFilter extends OncePerRequestFilter{
//Get the path
MDC.put("url", request.getRequestURI());
//Continue to the controller
filterChain.doFilter(request, response);
//Clear the MDC for the next request
MDC.clear();
}
}

View File

@@ -1,6 +1,7 @@
package com.mattrixwv.cipherstream.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
@@ -11,9 +12,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Component
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer{
@Value("${allowedOrigins}")
private String allowedOrigins;
@Override
public void addCorsMappings(@NonNull CorsRegistry registry){
registry.addMapping("/**")
.allowedOriginPatterns("http://localhost:3000");
.allowedOriginPatterns(allowedOrigins);
}
}

View File

@@ -0,0 +1,18 @@
package com.mattrixwv.cipherstream.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RestController
public class HealthCheckController{
@RequestMapping(value = "/health", method = RequestMethod.OPTIONS)
public void healthCheck(){
log.debug("Health check");
}
}

View File

@@ -0,0 +1,27 @@
{
"groups":[
],
"properties":[
{
"name": "allowed-origins",
"type": "java.lang.String",
"description": "Allowed CORS origins",
"defaultValue": "http://localhost:3000"
}
],
"hints":[
{
"name": "allowed-origins",
"values": [
{
"value": "http://localhost:3000",
"description": "Local development"
},
{
"value": "https://api.cipherstream.mattrixwv.com",
"description": "Production"
}
]
}
]
}

View File

@@ -1 +1,8 @@
#Server options
server.error.include-stacktrace=always
server.port=8001
server.shutdown=graceful
spring.lifecycle.timeoutPerShutdownPhase=10s
#CORS
allowedOrigins=http://localhost:3000

View File

@@ -1,10 +1,10 @@
#Mono-Substitution
#Affine
cipher.mono.affine.name=Affine
cipher.mono.affine.description=The Affine cipher is a monoalphabetic substitution cipher where each letter in the alphabet is mapped to a numeric equivalent and encrypted using a mathematical function.
cipher.mono.affine.description=The Affine cipher is a mono-alphabetic substitution cipher where each letter in the alphabet is mapped to a numeric equivalent and encrypted using a mathematical function.
cipher.mono.affine.explanation={\
"Encryption is performed by converting every letter to a number with a = 0, b = 1, c = 2, etc., then applying a function to each number, then converting each number back to a letter.",\
"The formula used in this encryption is F(x) = (ax + b) % m, where x is the original letter, a and b are the keys of the cipher, and m is the length of the alphabet, with a and m being coprime.",\
"The formula used in this encryption is F(x) = (ax + b) % m, where x is the original letter, a and b are the keys of the cipher, and m is the length of the alphabet, with a and m being co-prime.",\
"Decryption is performed using the formula F(x) = a^-1(x - b) % m.",\
"The Affine cipher is a relatively weak cipher compared to modern encryption methods because it's vulnerable to frequency analysis and other cryptanalysis techniques. However, it's simple to implement and understand, making it a good introduction to encryption concepts."\
}
@@ -15,7 +15,7 @@ cipher.mono.affine.facts={\
cipher.mono.atbash.name=Atbash
cipher.mono.atbash.description=The Atbash cipher is a substitution cipher where each letter of the plaintext is replaced by its counterpart in the reverse alphabet.
cipher.mono.atbash.explanation={\
"The Atbash cipher is a monoalphabetic substitution cipher and is one of the simplest and oldest forms of encryption.",\
"The Atbash cipher is a mono-alphabetic substitution cipher and is one of the simplest and oldest forms of encryption.",\
"Encryption involves replacing each letter with its reverse counterpart. i.e. A becomes Z, B becomes Y, etc.",\
"Decryption is performed using the same formula as encryption.",\
"Atbash cipher can effectively obscure the meaning of a message to those unfamiliar with the technique. However, it's very vulnerable to cryptanalysis, especially frequency analysis, and it provides very little security against modern decryption techniques."\
@@ -28,15 +28,15 @@ cipher.mono.atbash.facts={\
#Autokey
cipher.mono.autokey.name=Autokey
cipher.mono.autokey.description=The Autokey cipher is a polyalphabetic substitution cipher where each letter of the plaintext is combined with a letter from a predetermined key sequence to generate the ciphertext.
cipher.mono.autokey.description=The Autokey cipher is a poly-alphabetic substitution cipher where each letter of the plaintext is combined with a letter from a predetermined key sequence to generate the ciphertext.
cipher.mono.autokey.explanation={\
"The autokey cipher extends the Vigenere cipher. Like the Vigenere cipher it uses a keyword to encrypt plaintext, but it also incorporates the plaintext itself into the keystream.",\
"The autokey cipher extends the Vigenere cipher. Like the Vigenere cipher it uses a keyword to encrypt plaintext, but it also incorporates the plaintext itself into the key stream.",\
"Encryption works by concatenating the message to the keyword. Then you convert the resulting key into a series of numeric values mod 26. Then you advance each letter the indicated number of letters similar to the Caesar cipher.",\
"Decryption works by converting the key the same as encryption, but instead of advancing each letter the given amount the values retreat. As each letter is decrypted the letter needs added to the key as well as the output so that decryption can continue.",\
"The Autokey cipher is more secure than the Vigenere cipher due to the keyword including part of the text to be encoded. However, like the Vigenere cipher, the Autokey cipher is vulnerable to frequency analysis and other cryptanalysis techniques, especially if the keyword is short or if there are patterns in the plaintext."\
}
cipher.mono.autokey.facts={\
"The Autokey cipher was the inspiriation for the ADFGVX cipher, which Germany used during World War I",\
"The Autokey cipher was the inspiration for the ADFGVX cipher, which Germany used during World War I",\
"It has also served as the precursor to more complex modern encryption methods"\
}
@@ -111,7 +111,7 @@ cipher.mono.onetimepad.facts={\
#Porta
cipher.mono.porta.name=Porta
cipher.mono.porta.description=The Porta cipher is a polyalphabetic substitution cipher where each letter in the plaintext is shifted based on a keyword, using a fixed tabula.
cipher.mono.porta.description=The Porta cipher is a poly-alphabetic substitution cipher where each letter in the plaintext is shifted based on a keyword, using a fixed tabula.
cipher.mono.porta.explanation={\
"The Porta cipher, also known as the Porta square or Portax cipher, is a variant of the Vigenere cipher and shares some similarities with it.",\
"In the Porta cipher, encryption and decryption are performed using a keyword and a tabula recta or Porta square. The Porta square is a table that consists of 26 rows and 26 columns, where each row represents the alphabet shifted by a certain number of positions.",\
@@ -121,8 +121,8 @@ cipher.mono.porta.explanation={\
}
cipher.mono.porta.facts={\
"It was invented by Giovanni Battista della Porta in the 16th century.",\
"It is one of the earliest known polyalphabetic ciphers, preceding the Vigenere cipher by several centuries.",\
"It was one of the first ciphers to use a keyword to deetermine the alphabetic shift."\
"It is one of the earliest known poly-alphabetic ciphers, preceding the Vigenere cipher by several centuries.",\
"It was one of the first ciphers to use a keyword to determine the alphabetic shift."\
}
#Substitution
@@ -142,9 +142,9 @@ cipher.mono.substitution.facts={\
#Vigenere
cipher.mono.vigenere.name=Vigenere
cipher.mono.vigenere.description=The Vigenere cipher is a polyalphabetic encryption method that uses a keyword and series of interwoven Caesar ciphers.
cipher.mono.vigenere.description=The Vigenere cipher is a poly-alphabetic encryption method that uses a keyword and series of interwoven Caesar ciphers.
cipher.mono.vigenere.explanation={\
"The Vigenere cipher adds more security compared to simple monoalphabetic substitution ciphers like the Caesar cipher.",\
"The Vigenere cipher adds more security compared to simple mono-alphabetic substitution ciphers like the Caesar cipher.",\
"In the Vigenere cipher, encryption and decryption are performed using a keyword or keyphrase. The key is used to determine the shift applied to each letter in the plaintext, with different parts of the key determining different shifts.",\
"Decryption is performed by applying the reverse process. Given the ciphertext and the keyword, the original plaintext can be recovered.",\
"The Vigenere cipher provides stronger encryption compared to simple substitution ciphers because it uses multiple Caesar ciphers in a repeating pattern determined by the keyword.",\
@@ -153,7 +153,7 @@ cipher.mono.vigenere.explanation={\
}
cipher.mono.vigenere.facts={\
"It was invented by Giovan Battista Bellaso in the 16th century and later misattributed to Blaise de Vigenere, hence the name.",\
"It is one of the earliest known examples of a polyalphabetic substitution cipher.",\
"It is one of the earliest known examples of a poly-alphabetic substitution cipher.",\
"It was cracked in the mid-19th century by Charles Babbage's assistant, Friedrich Kasiski. The method now known as the Kasiski examination exploits the repeated patters in the ciphertext to determine the length of the keyword."\
}
@@ -163,7 +163,7 @@ cipher.mono.vigenere.facts={\
cipher.poly.bifid.name=Bifid
cipher.poly.bifid.description=The Bifid cipher involves converting plaintext characters into coordinates in a 5x5 grid, then transposing them into a single string using a keyword.
cipher.poly.bifid.explanation={\
"The Bifid cipher is a type of polyalphabetic substitution cipher that combines elements of both transposition and substitution.",\
"The Bifid cipher is a type of poly-alphabetic substitution cipher that combines elements of both transposition and substitution.",\
"It was invented by Felix Delastelle in 1901 and was considered one of the strongest ciphers at the time due to its complexity.",\
"Encryption is done by creating a 5x5 grid, known as the Polybius square, is created. The letters of the alphabet (excluding 'J' in most cases) are arranged in the grid, typically starting with 'A' and ending with 'Z', omitting 'J'.",\
"Each letter of the plaintext is first converted into its corresponding row and column numbers in the grid. For example, the letter 'C' may correspond to the row 1, column 3. These numerical representations are then combined into pairs of numbers.",\
@@ -212,7 +212,7 @@ cipher.poly.morse.name=Morse Code
cipher.poly.morse.description=Morse code is a method of transmitting text information as a series of on-off tones, lights, or clicks, with each character represented by a unique sequence of dots and dashes.
cipher.poly.morse.explanation={\
"Morse code is a method of transmitting text information as a series of on-off tones, lights, or clicks. Morse code encodes characters (letters, numbers, and punctuation) as sequences of dots (short signals) and dashes (long signals) arranged in specific patterns.",\
"The basic elemens of Morse Code are dots and dashes. Each letter, number, or punctuation mark is represented by a unique combination of dots and dashes. Numbers and punctuation marks also have their own Morse code representations.",\
"The basic elements of Morse Code are dots and dashes. Each letter, number, or punctuation mark is represented by a unique combination of dots and dashes. Numbers and punctuation marks also have their own Morse code representations.",\
"Morse code has been widely used in various forms of communication, including telegraphy, radio communication, aviation, and navigation. Despite advances in technology, Morse code remains relevant today, particularly in emergency communication, amateur radio, and certain military applications. It is also used by some individuals for its simplicity and effectiveness in situations where other forms of communication may be unreliable or unavailable."\
}
cipher.poly.morse.facts={\
@@ -272,9 +272,9 @@ cipher.poly.railfence.facts={\
cipher.poly.trifid.name=Trifid
cipher.poly.trifid.description=The Trifid cipher is a polygraphic substitution cipher substituting each letter in the plaintext with coordinates in a 3x3x3 grid.
cipher.poly.trifid.explanation={\
"The trifid cipher is a polygraphic substitution cipher and is an extention of the Bifid cipher.",\
"The trifid cipher is a polygraphic substitution cipher and is an extension of the Bifid cipher.",\
"To encode, a key matrix is generated, typically a permutation of the alphabet plus some additional symbols. Each letter of the plaintext is converted into its corresponding coordinates in the 3x3x3 grid. For example, if the letter is 'A', it could be represented as (1,1,1).",\
"The coordinates are then rearranged according to the key matrix and teh plaintext coordinate is (1,1,1), in might be rearranged to 2,3,1 based on the position of 'A' in the key matrix. The rearranged coordinates are converted back into letters.",\
"The coordinates are then rearranged according to the key matrix and the plaintext coordinate is (1,1,1), it might be rearranged to 2,3,1 based on the position of 'A' in the key matrix. The rearranged coordinates are converted back into letters.",\
"The process is reversed. The ciphertext is first converted into coordinates, rearranged back using the key matrix, and then converted back into plaintext.",\
"The Trifid cipher provides a higher degree of security compared to simpler ciphers like Caesar or Atbash, but it's still vulnerable to cryptanalysis, especially with modern computational methods. Despite its age, it remains an interesting historical cipher and is occasionally used in puzzles and cryptography challenges."\
}

View File

@@ -10,6 +10,8 @@
</Pattern>
</PatternLayout>
</Console>
<RollingRandomAccessFile name="file" fileName="cipherStreamAPI.log" filePattern="%d{MM-dd-yyyy}-cipherStreamAPI.log.gz" immediateFlush="true">
<JsonTemplateLayout eventTemplateUri="classpath:template.json"></JsonTemplateLayout>
<Policies>
@@ -17,6 +19,16 @@
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingRandomAccessFile>
<Console name="consoleJSON" target="SYSTEM_OUT">
<JsonTemplateLayout eventTemplateUri="classpath:template.json"/>
</Console>
<Socket name="graylog" host="loggingpi.mattrixwv.com" port="1502">
<JsonTemplateLayout eventTemplateUri="classpath:template.json"/>
</Socket>
</Appenders>
<Loggers>

View File

@@ -1,8 +1,8 @@
{
"timestamp": {
"msg_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

View File

@@ -42,7 +42,7 @@ public class CipherStreamLoggingAspectTest{
jsonNode.put("something", "Something Important");
aspect.getCipherInfo(null);
aspect.getCipherInfo(jsonNode);
assertNotNull(aspect);

View File

@@ -15,14 +15,13 @@ import org.mockito.Mock;
import org.slf4j.Logger;
import org.slf4j.spi.MDCAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.test.web.servlet.MockMvc;
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
import com.mattrixwv.cipherstream.controller.monosubstitution.CaesarCipherController;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@Tag("integration-test")
@WebMvcTest(controllers = CaesarCipherController.class)
@@ -30,10 +29,6 @@ public class FullFilterIntegrationTest{
//HTTP
@Autowired
private MockMvc mockMvc;
@Mock
private HttpServletRequest request;
@Mock
private HttpServletResponse response;
//Logging
@Mock(name = "com.mattrixwv.cipherstream.config.FullFilter")
private Logger logger;
@@ -43,6 +38,8 @@ public class FullFilterIntegrationTest{
private static final String url = "/caesar";
private UUID requestId = UUID.randomUUID();
private String ipAddresses = "192.168.1.1,192.168.1.2,192.168.1.3";
@Value("${cipher.mono.caesar.name}")
private String caesarName;
@Test
@@ -57,21 +54,45 @@ public class FullFilterIntegrationTest{
.andExpect(status().isOk());
verify(logger, times(1)).info(eq("Request parameters: {}"), any(StringJoiner.class));
verifyNoMoreInteractions(logger);
verify(mdc, times(1)).put("requestId", requestId.toString());
verify(mdc, times(1)).put("ip", "192.168.1.1");
verify(mdc, times(1)).put("url", url);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName);
verify(mdc, times(1)).clear();
verifyNoMoreInteractions(mdc);
}
@Test
public void testDoFilterInternal_NoParameters() throws Exception{
public void testDoFilterInternal_noParameters() throws Exception{
mockMvc.perform(get(url)
.header("X-Request-Id", requestId)
.header("X-Forwarded-For", ipAddresses))
.andExpect(status().isOk());
verify(logger, never()).info(anyString(), any(Object.class));
verifyNoMoreInteractions(logger);
verify(mdc, times(1)).put("requestId", requestId.toString());
verify(mdc, times(1)).put("ip", "192.168.1.1");
verify(mdc, times(1)).put("url", url);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName);
verify(mdc, times(1)).clear();
verifyNoMoreInteractions(mdc);
}
@Test
public void testDoFilterInternal_options() throws Exception{
mockMvc.perform(options(url)
.header("X-Request-Id", requestId)
.header("X-Forwarded-For", ipAddresses)
.param("param1", "value1")
.param("param2", "value2.1")
.param("param2", "value2.2")
.param("_", "value3"))
.andExpect(status().isOk());
verifyNoInteractions(logger);
verify(mdc, times(1)).clear();
verifyNoMoreInteractions(mdc);
}
}

View File

@@ -38,6 +38,7 @@ public class FullFilterTest{
parameterMap.put("_", new String[]{"value3"});
doReturn("GET").when(request).getMethod();
doReturn("X-Request-Id").when(request).getHeader("X-Request-Id");
doReturn("192.168.1.1,192.168.1.2,192.168.1.3").when(request).getHeader("X-Forwarded-For");
doReturn(parameterMap).when(request).getParameterMap();
@@ -47,14 +48,18 @@ public class FullFilterTest{
fullFilter.doFilterInternal(request, response, filterChain);
verify(request, times(1)).getMethod();
verify(request, times(2)).getHeader("X-Request-Id");
verify(request, times(2)).getHeader("X-Forwarded-For");
verify(request, times(1)).getParameterMap();
verifyNoMoreInteractions(request);
verify(filterChain, times(1)).doFilter(request, response);
verifyNoMoreInteractions(filterChain);
}
@Test
public void testDoFilterInternal_NoParameters() throws Exception{
doReturn("GET").when(request).getMethod();
doReturn("X-Request-Id").when(request).getHeader("X-Request-Id");
doReturn("192.168.1.1,192.168.1.2,192.168.1.3").when(request).getHeader("X-Forwarded-For");
doReturn(new HashMap<>()).when(request).getParameterMap();
@@ -64,14 +69,18 @@ public class FullFilterTest{
fullFilter.doFilterInternal(request, response, filterChain);
verify(request, times(1)).getMethod();
verify(request, times(2)).getHeader("X-Request-Id");
verify(request, times(2)).getHeader("X-Forwarded-For");
verify(request, times(1)).getParameterMap();
verifyNoMoreInteractions(request);
verify(filterChain, times(1)).doFilter(request, response);
verifyNoMoreInteractions(filterChain);
}
@Test
public void testDoFilterInternal_noHeaders() throws Exception{
doReturn("GET").when(request).getMethod();
doReturn(new HashMap<>()).when(request).getParameterMap();
doReturn("/testURL").when(request).getRequestURI();
@@ -79,9 +88,26 @@ public class FullFilterTest{
fullFilter.doFilterInternal(request, response, filterChain);
verify(request, times(1)).getMethod();
verify(request, times(1)).getHeader("X-Request-Id");
verify(request, times(1)).getHeader("X-Forwarded-For");
verify(request, times(1)).getParameterMap();
verifyNoMoreInteractions(request);
verify(filterChain, times(1)).doFilter(request, response);
verifyNoMoreInteractions(filterChain);
}
@Test
public void testDoFilterInternal_options() throws Exception{
doReturn("OPTIONS").when(request).getMethod();
fullFilter.doFilterInternal(request, response, filterChain);
verify(request, times(1)).getMethod();
verifyNoMoreInteractions(request);
verify(filterChain, times(1)).doFilter(request, response);
verifyNoMoreInteractions(filterChain);
}
}

View File

@@ -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);
}
}

View File

@@ -0,0 +1,53 @@
package com.mattrixwv.cipherstream.controller;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.slf4j.Logger;
import org.slf4j.spi.MDCAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.aop.AopAutoConfiguration;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.web.servlet.MockMvc;
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
import com.mattrixwv.cipherstream.config.FullFilter;
@Tag("integration-test")
@WebMvcTest(controllers = HealthCheckController.class)
@Import({AopAutoConfiguration.class, FullFilter.class, CipherStreamLoggingAspect.class})
public class HealthCheckControllerIntegrationTest{
@Autowired
private MockMvc mockMvc;
//MDC
@Mock
private MDCAdapter mdc;
//Logging
@Mock(name = "com.mattrixwv.cipherstream.controller.HealthCheckController")
private Logger healthLogger;
@Mock(name = "com.mattrixwv.cipherstream.config.FullFilter")
private Logger filterLogger;
@Mock(name = "com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect")
protected Logger aspectLogger;
@Test
public void testHealthCheck() throws Exception{
mockMvc.perform(options("/health"))
.andExpect(status().isOk());
//Verify results
verify(healthLogger, times(1)).debug("Health check");
verifyNoInteractions(filterLogger);
verifyNoInteractions(aspectLogger);
verify(mdc, times(1)).clear();
verifyNoMoreInteractions(mdc);
}
}

View File

@@ -96,6 +96,7 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url);
//Controller
verify(adfgvxLogger, times(1)).info("Getting info for {}", adfgvxName);
verifyNoMoreInteractions(adfgvxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
}
@@ -114,9 +115,10 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(adfgvxLogger, times(1)).info("Encoding {}", adfgvxName);
verifyNoMoreInteractions(adfgvxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -134,6 +136,7 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(adfgvxLogger, times(1)).info("Encoding {}", adfgvxName);
verifyNoMoreInteractions(adfgvxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -154,9 +157,10 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(adfgvxLogger, times(1)).info("Decoding {}", adfgvxName);
verifyNoMoreInteractions(adfgvxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -174,6 +178,7 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(adfgvxLogger, times(1)).info("Decoding {}", adfgvxName);
verifyNoMoreInteractions(adfgvxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -96,6 +96,7 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url);
//Controller
verify(adfgxLogger, times(1)).info("Getting info for {}", adfgxName);
verifyNoMoreInteractions(adfgxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
}
@@ -114,9 +115,10 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/encode");
//Controller
verify(adfgxLogger, times(1)).info("Encoding {}", adfgxName);
verifyNoMoreInteractions(adfgxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -134,6 +136,7 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/encode");
//Controller
verify(adfgxLogger, times(1)).info("Encoding {}", adfgxName);
verifyNoMoreInteractions(adfgxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -154,9 +157,10 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/decode");
//Controller
verify(adfgxLogger, times(1)).info("Decoding {}", adfgxName);
verifyNoMoreInteractions(adfgxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -174,6 +178,7 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/decode");
//Controller
verify(adfgxLogger, times(1)).info("Decoding {}", adfgxName);
verifyNoMoreInteractions(adfgxLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -96,6 +96,7 @@ public class AffineCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url);
//Controller
verify(affineLogger, times(1)).info("Getting info for {}", affineName);
verifyNoMoreInteractions(affineLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, affineName);
}
@@ -114,9 +115,10 @@ public class AffineCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(affineLogger, times(1)).info("Encoding {}", affineName);
verifyNoMoreInteractions(affineLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, affineName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -134,6 +136,7 @@ public class AffineCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(affineLogger, times(1)).info("Encoding {}", affineName);
verifyNoMoreInteractions(affineLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, affineName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -154,9 +157,10 @@ public class AffineCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(affineLogger, times(1)).info("Decoding {}", affineName);
verifyNoMoreInteractions(affineLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, affineName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -174,6 +178,7 @@ public class AffineCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(affineLogger, times(1)).info("Decoding {}", affineName);
verifyNoMoreInteractions(affineLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, affineName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -90,6 +90,7 @@ public class AtbashCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url);
//Controller
verify(atbashLogger, times(1)).info("Getting info for {}", atbashName);
verifyNoMoreInteractions(atbashLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, atbashName);
}
@@ -108,9 +109,10 @@ public class AtbashCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(atbashLogger, times(1)).info("Encoding {}", atbashName);
verifyNoMoreInteractions(atbashLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, atbashName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -128,6 +130,7 @@ public class AtbashCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(atbashLogger, times(1)).info("Encoding {}", atbashName);
verifyNoMoreInteractions(atbashLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, atbashName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -148,9 +151,10 @@ public class AtbashCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(atbashLogger, times(1)).info("Decoding {}", atbashName);
verifyNoMoreInteractions(atbashLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, atbashName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -168,6 +172,7 @@ public class AtbashCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(atbashLogger, times(1)).info("Decoding {}", atbashName);
verifyNoMoreInteractions(atbashLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, atbashName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class AutokeyCipherControllerIntegrationTest extends CipherStreamControll
super.verifyFilter(url);
//Controller
verify(autokeyLogger, times(1)).info("Getting info for {}", autokeyName);
verifyNoMoreInteractions(autokeyLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, autokeyName);
}
@@ -111,9 +112,10 @@ public class AutokeyCipherControllerIntegrationTest extends CipherStreamControll
super.verifyFilter(url + "/encode");
//Controller
verify(autokeyLogger, times(1)).info("Encoding {}", autokeyName);
verifyNoMoreInteractions(autokeyLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, autokeyName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class AutokeyCipherControllerIntegrationTest extends CipherStreamControll
super.verifyFilter(url + "/encode");
//Controller
verify(autokeyLogger, times(1)).info("Encoding {}", autokeyName);
verifyNoMoreInteractions(autokeyLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, autokeyName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class AutokeyCipherControllerIntegrationTest extends CipherStreamControll
super.verifyFilter(url + "/decode");
//Controller
verify(autokeyLogger, times(1)).info("Decoding {}", autokeyName);
verifyNoMoreInteractions(autokeyLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, autokeyName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class AutokeyCipherControllerIntegrationTest extends CipherStreamControll
super.verifyFilter(url + "/decode");
//Controller
verify(autokeyLogger, times(1)).info("Decoding {}", autokeyName);
verifyNoMoreInteractions(autokeyLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, autokeyName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -90,6 +90,7 @@ public class BaconianCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url);
//Controller
verify(baconianLogger, times(1)).info("Getting info for {}", baconianName);
verifyNoMoreInteractions(baconianLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
}
@@ -108,9 +109,10 @@ public class BaconianCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(baconianLogger, times(1)).info("Encoding {}", baconianName);
verifyNoMoreInteractions(baconianLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -128,6 +130,7 @@ public class BaconianCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(baconianLogger, times(1)).info("Encoding {}", baconianName);
verifyNoMoreInteractions(baconianLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -148,9 +151,10 @@ public class BaconianCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(baconianLogger, times(1)).info("Decoding {}", baconianName);
verifyNoMoreInteractions(baconianLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -168,6 +172,7 @@ public class BaconianCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(baconianLogger, times(1)).info("Decoding {}", baconianName);
verifyNoMoreInteractions(baconianLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class BaseXCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url);
//Controller
verify(baseXLogger, times(1)).info("Getting info for {}", baseXName);
verifyNoMoreInteractions(baseXLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baseXName);
}
@@ -111,9 +112,10 @@ public class BaseXCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/encode");
//Controller
verify(baseXLogger, times(1)).info("Encoding {}", baseXName);
verifyNoMoreInteractions(baseXLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baseXName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class BaseXCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/encode");
//Controller
verify(baseXLogger, times(1)).info("Encoding {}", baseXName);
verifyNoMoreInteractions(baseXLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baseXName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class BaseXCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/decode");
//Controller
verify(baseXLogger, times(1)).info("Decoding {}", baseXName);
verifyNoMoreInteractions(baseXLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baseXName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class BaseXCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/decode");
//Controller
verify(baseXLogger, times(1)).info("Decoding {}", baseXName);
verifyNoMoreInteractions(baseXLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baseXName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class BeaufortCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url);
//Controller
verify(beaufortLogger, times(1)).info("Getting info for {}", beaufortName);
verifyNoMoreInteractions(beaufortLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, beaufortName);
}
@@ -111,9 +112,10 @@ public class BeaufortCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(beaufortLogger, times(1)).info("Encoding {}", beaufortName);
verifyNoMoreInteractions(beaufortLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, beaufortName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class BeaufortCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(beaufortLogger, times(1)).info("Encoding {}", beaufortName);
verifyNoMoreInteractions(beaufortLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, beaufortName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class BeaufortCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(beaufortLogger, times(1)).info("Decoding {}", beaufortName);
verifyNoMoreInteractions(beaufortLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, beaufortName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class BeaufortCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(beaufortLogger, times(1)).info("Decoding {}", beaufortName);
verifyNoMoreInteractions(beaufortLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, beaufortName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class CaesarCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url);
//Controller
verify(caesarLogger, times(1)).info("Getting info for {}", caesarName);
verifyNoMoreInteractions(caesarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName);
}
@@ -111,9 +112,10 @@ public class CaesarCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(caesarLogger, times(1)).info("Encoding {}", caesarName);
verifyNoMoreInteractions(caesarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class CaesarCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(caesarLogger, times(1)).info("Encoding {}", caesarName);
verifyNoMoreInteractions(caesarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class CaesarCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(caesarLogger, times(1)).info("Decoding {}", caesarName);
verifyNoMoreInteractions(caesarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class CaesarCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(caesarLogger, times(1)).info("Decoding {}", caesarName);
verifyNoMoreInteractions(caesarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, caesarName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class OneTimePadCipherControllerIntegrationTest extends CipherStreamContr
super.verifyFilter(url);
//Controller
verify(oneTimePadLogger, times(1)).info("Getting info for {}", oneTimePadName);
verifyNoMoreInteractions(oneTimePadLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, oneTimePadName);
}
@@ -111,9 +112,10 @@ public class OneTimePadCipherControllerIntegrationTest extends CipherStreamContr
super.verifyFilter(url + "/encode");
//Controller
verify(oneTimePadLogger, times(1)).info("Encoding {}", oneTimePadName);
verifyNoMoreInteractions(oneTimePadLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, oneTimePadName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class OneTimePadCipherControllerIntegrationTest extends CipherStreamContr
super.verifyFilter(url + "/encode");
//Controller
verify(oneTimePadLogger, times(1)).info("Encoding {}", oneTimePadName);
verifyNoMoreInteractions(oneTimePadLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, oneTimePadName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class OneTimePadCipherControllerIntegrationTest extends CipherStreamContr
super.verifyFilter(url + "/decode");
//Controller
verify(oneTimePadLogger, times(1)).info("Decoding {}", oneTimePadName);
verifyNoMoreInteractions(oneTimePadLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, oneTimePadName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class OneTimePadCipherControllerIntegrationTest extends CipherStreamContr
super.verifyFilter(url + "/decode");
//Controller
verify(oneTimePadLogger, times(1)).info("Decoding {}", oneTimePadName);
verifyNoMoreInteractions(oneTimePadLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, oneTimePadName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -94,6 +94,7 @@ public class PortaCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url);
//Controller
verify(portaLogger, times(1)).info("Getting info for {}", portaName);
verifyNoMoreInteractions(portaLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, portaName);
}
@@ -116,9 +117,10 @@ public class PortaCipherControllerIntegrationTest extends CipherStreamController
verify(mdc, times(1)).clear();
//Controller
verify(portaLogger, times(1)).info("Encoding {}", portaName);
verifyNoMoreInteractions(portaLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, portaName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -136,6 +138,7 @@ public class PortaCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/encode");
//Controller
verify(portaLogger, times(1)).info("Encoding {}", portaName);
verifyNoMoreInteractions(portaLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, portaName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -160,9 +163,10 @@ public class PortaCipherControllerIntegrationTest extends CipherStreamController
verify(mdc, times(1)).clear();
//Controller
verify(portaLogger, times(1)).info("Decoding {}", portaName);
verifyNoMoreInteractions(portaLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, portaName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -180,6 +184,7 @@ public class PortaCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/decode");
//Controller
verify(portaLogger, times(1)).info("Decoding {}", portaName);
verifyNoMoreInteractions(portaLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, portaName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class SubstitutionCipherControllerIntegrationTest extends CipherStreamCon
super.verifyFilter(url);
//Controller
verify(substitutionLogger, times(1)).info("Getting info for {}", substitutionName);
verifyNoMoreInteractions(substitutionLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, substitutionName);
}
@@ -111,9 +112,10 @@ public class SubstitutionCipherControllerIntegrationTest extends CipherStreamCon
super.verifyFilter(url + "/encode");
//Controller
verify(substitutionLogger, times(1)).info("Encoding {}", substitutionName);
verifyNoMoreInteractions(substitutionLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, substitutionName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class SubstitutionCipherControllerIntegrationTest extends CipherStreamCon
super.verifyFilter(url + "/encode");
//Controller
verify(substitutionLogger, times(1)).info("Encoding {}", substitutionName);
verifyNoMoreInteractions(substitutionLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, substitutionName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class SubstitutionCipherControllerIntegrationTest extends CipherStreamCon
super.verifyFilter(url + "/decode");
//Controller
verify(substitutionLogger, times(1)).info("Decoding {}", substitutionName);
verifyNoMoreInteractions(substitutionLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, substitutionName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class SubstitutionCipherControllerIntegrationTest extends CipherStreamCon
super.verifyFilter(url + "/decode");
//Controller
verify(substitutionLogger, times(1)).info("Decoding {}", substitutionName);
verifyNoMoreInteractions(substitutionLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, substitutionName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class VigenereCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url);
//Controller
verify(vigenereLogger, times(1)).info("Getting info for {}", vigenereName);
verifyNoMoreInteractions(vigenereLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
}
@@ -111,9 +112,10 @@ public class VigenereCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(vigenereLogger, times(1)).info("Encoding {}", vigenereName);
verifyNoMoreInteractions(vigenereLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class VigenereCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(vigenereLogger, times(1)).info("Encoding {}", vigenereName);
verifyNoMoreInteractions(vigenereLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class VigenereCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(vigenereLogger, times(1)).info("Decoding {}", vigenereName);
verifyNoMoreInteractions(vigenereLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class VigenereCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(vigenereLogger, times(1)).info("Decoding {}", vigenereName);
verifyNoMoreInteractions(vigenereLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class BifidCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url);
//Controller
verify(bifidLogger, times(1)).info("Getting info for {}", bifidName);
verifyNoMoreInteractions(bifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, bifidName);
}
@@ -111,9 +112,10 @@ public class BifidCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/encode");
//Controller
verify(bifidLogger, times(1)).info("Encoding {}", bifidName);
verifyNoMoreInteractions(bifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, bifidName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class BifidCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/encode");
//Controller
verify(bifidLogger, times(1)).info("Encoding {}", bifidName);
verifyNoMoreInteractions(bifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, bifidName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class BifidCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/decode");
//Controller
verify(bifidLogger, times(1)).info("Decoding {}", bifidName);
verifyNoMoreInteractions(bifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, bifidName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class BifidCipherControllerIntegrationTest extends CipherStreamController
super.verifyFilter(url + "/decode");
//Controller
verify(bifidLogger, times(1)).info("Decoding {}", bifidName);
verifyNoMoreInteractions(bifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, bifidName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class ColumnarCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url);
//Controller
verify(columnarLogger, times(1)).info("Getting info for {}", columnarName);
verifyNoMoreInteractions(columnarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, columnarName);
}
@@ -111,9 +112,10 @@ public class ColumnarCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(columnarLogger, times(1)).info("Encoding {}", columnarName);
verifyNoMoreInteractions(columnarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, columnarName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class ColumnarCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(columnarLogger, times(1)).info("Encoding {}", columnarName);
verifyNoMoreInteractions(columnarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, columnarName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class ColumnarCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(columnarLogger, times(1)).info("Decoding {}", columnarName);
verifyNoMoreInteractions(columnarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, columnarName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class ColumnarCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(columnarLogger, times(1)).info("Decoding {}", columnarName);
verifyNoMoreInteractions(columnarLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, columnarName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class HillCipherControllerIntegrationTest extends CipherStreamControllerI
super.verifyFilter(url);
//Controller
verify(hillLogger, times(1)).info("Getting info for {}", hillName);
verifyNoMoreInteractions(hillLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
}
@@ -111,9 +112,10 @@ public class HillCipherControllerIntegrationTest extends CipherStreamControllerI
super.verifyFilter(url + "/encode");
//Controller
verify(hillLogger, times(1)).info("Encoding {}", hillName);
verifyNoMoreInteractions(hillLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class HillCipherControllerIntegrationTest extends CipherStreamControllerI
super.verifyFilter(url + "/encode");
//Controller
verify(hillLogger, times(1)).info("Encoding {}", hillName);
verifyNoMoreInteractions(hillLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class HillCipherControllerIntegrationTest extends CipherStreamControllerI
super.verifyFilter(url + "/decode");
//Controller
verify(hillLogger, times(1)).info("Decoding {}", hillName);
verifyNoMoreInteractions(hillLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class HillCipherControllerIntegrationTest extends CipherStreamControllerI
super.verifyFilter(url + "/decode");
//Controller
verify(hillLogger, times(1)).info("Decoding {}", hillName);
verifyNoMoreInteractions(hillLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -83,6 +83,7 @@ public class MorseCodeControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url);
//Controller
verify(morseLogger, times(1)).info("Getting info for {}", morseName);
verifyNoMoreInteractions(morseLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, morseName);
}
@@ -101,9 +102,10 @@ public class MorseCodeControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/encode");
//Controller
verify(morseLogger, times(1)).info("Encoding {}", morseName);
verifyNoMoreInteractions(morseLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, morseName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -121,6 +123,7 @@ public class MorseCodeControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/encode");
//Controller
verify(morseLogger, times(1)).info("Encoding {}", morseName);
verifyNoMoreInteractions(morseLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, morseName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -141,9 +144,10 @@ public class MorseCodeControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/decode");
//Controller
verify(morseLogger, times(1)).info("Decoding {}", morseName);
verifyNoMoreInteractions(morseLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, morseName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -161,6 +165,7 @@ public class MorseCodeControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/decode");
//Controller
verify(morseLogger, times(1)).info("Decoding {}", morseName);
verifyNoMoreInteractions(morseLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, morseName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -94,6 +94,7 @@ public class PlayfairCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url);
//Controller
verify(playfairLogger, times(1)).info("Getting info for {}", playfairName);
verifyNoMoreInteractions(playfairLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, playfairName);
}
@@ -112,9 +113,10 @@ public class PlayfairCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(playfairLogger, times(1)).info("Encoding {}", playfairName);
verifyNoMoreInteractions(playfairLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, playfairName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -132,6 +134,7 @@ public class PlayfairCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(playfairLogger, times(1)).info("Encoding {}", playfairName);
verifyNoMoreInteractions(playfairLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, playfairName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -152,9 +155,10 @@ public class PlayfairCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(playfairLogger, times(1)).info("Decoding {}", playfairName);
verifyNoMoreInteractions(playfairLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, playfairName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -172,6 +176,7 @@ public class PlayfairCipherControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(playfairLogger, times(1)).info("Decoding {}", playfairName);
verifyNoMoreInteractions(playfairLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, playfairName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class PolybiusSquareControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url);
//Controller
verify(polybiusLogger, times(1)).info("Getting info for {}", polybiusName);
verifyNoMoreInteractions(polybiusLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, polybiusName);
}
@@ -111,9 +112,10 @@ public class PolybiusSquareControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(polybiusLogger, times(1)).info("Encoding {}", polybiusName);
verifyNoMoreInteractions(polybiusLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, polybiusName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class PolybiusSquareControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/encode");
//Controller
verify(polybiusLogger, times(1)).info("Encoding {}", polybiusName);
verifyNoMoreInteractions(polybiusLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, polybiusName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class PolybiusSquareControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(polybiusLogger, times(1)).info("Decoding {}", polybiusName);
verifyNoMoreInteractions(polybiusLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, polybiusName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class PolybiusSquareControllerIntegrationTest extends CipherStreamControl
super.verifyFilter(url + "/decode");
//Controller
verify(polybiusLogger, times(1)).info("Decoding {}", polybiusName);
verifyNoMoreInteractions(polybiusLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, polybiusName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -93,6 +93,7 @@ public class RailFenceControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url);
//Controller
verify(railFenceLogger, times(1)).info("Getting info for {}", railFenceName);
verifyNoMoreInteractions(railFenceLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, railFenceName);
}
@@ -111,9 +112,10 @@ public class RailFenceControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/encode");
//Controller
verify(railFenceLogger, times(1)).info("Encoding {}", railFenceName);
verifyNoMoreInteractions(railFenceLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, railFenceName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -131,6 +133,7 @@ public class RailFenceControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/encode");
//Controller
verify(railFenceLogger, times(1)).info("Encoding {}", railFenceName);
verifyNoMoreInteractions(railFenceLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, railFenceName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -151,9 +154,10 @@ public class RailFenceControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/decode");
//Controller
verify(railFenceLogger, times(1)).info("Decoding {}", railFenceName);
verifyNoMoreInteractions(railFenceLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, railFenceName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -171,6 +175,7 @@ public class RailFenceControllerIntegrationTest extends CipherStreamControllerIn
super.verifyFilter(url + "/decode");
//Controller
verify(railFenceLogger, times(1)).info("Decoding {}", railFenceName);
verifyNoMoreInteractions(railFenceLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, railFenceName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);

View File

@@ -99,6 +99,7 @@ public class TrifidCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url);
//Controller
verify(trifidLogger, times(1)).info("Getting info for {}", trifidName);
verifyNoMoreInteractions(trifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, trifidName);
}
@@ -117,9 +118,10 @@ public class TrifidCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(trifidLogger, times(1)).info("Encoding {}", trifidName);
verifyNoMoreInteractions(trifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, trifidName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", decodedNode);
verifyAspectLogging(decodedNode);
}
@Test
@@ -137,6 +139,7 @@ public class TrifidCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/encode");
//Controller
verify(trifidLogger, times(1)).info("Encoding {}", trifidName);
verifyNoMoreInteractions(trifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, trifidName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);
@@ -157,9 +160,10 @@ public class TrifidCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(trifidLogger, times(1)).info("Decoding {}", trifidName);
verifyNoMoreInteractions(trifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, trifidName);
//Cipher Aspect
verify(aspectLogger, times(1)).info("CipherStream log {}", encodedNode);
verifyAspectLogging(encodedNode);
}
@Test
@@ -177,6 +181,7 @@ public class TrifidCipherControllerIntegrationTest extends CipherStreamControlle
super.verifyFilter(url + "/decode");
//Controller
verify(trifidLogger, times(1)).info("Decoding {}", trifidName);
verifyNoMoreInteractions(trifidLogger);
verify(mdc, times(1)).put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, trifidName);
//Cipher Aspect
verifyNoInteractions(aspectLogger);