Update to add more properties

This commit is contained in:
2024-04-24 21:12:57 -04:00
parent 33bc1f6bd9
commit db314eb7f4
65 changed files with 669 additions and 104 deletions

View File

@@ -1,10 +1,13 @@
package com.mattrixwv.cipherstream.controller.combination;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
@@ -42,6 +45,8 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
private static final String squareKeyword = "SquareKeyword";
private static final String adfgvxName = "adfgvxName";
private static final String adfgvxDescription = "adfgvxDescription";
private static final List<String> adfgvxExplanation = List.of("adfgvxExplanation1", "adfgvxExplanation2", "adfgvxExplanation3");
private static final List<String> adfgvxFacts = List.of("adfgvxFact1", "adfgvxFact2", "adfgvxFact3");
@BeforeEach
@@ -66,6 +71,8 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxName", adfgvxName);
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxDescription", adfgvxDescription);
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxExplanation", adfgvxExplanation);
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxFacts", adfgvxFacts);
}
@@ -77,7 +84,13 @@ public class AdfgvxCipherControllerIntegrationTest extends CipherStreamControlle
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_NAME).value(adfgvxName))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_DESCRIPTION).value(adfgvxDescription));
.andExpect(jsonPath(CipherInfoUtil.CIPHER_DESCRIPTION).value(adfgvxDescription))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_EXPLANATION).isArray())
.andExpect(jsonPath(CipherInfoUtil.CIPHER_EXPLANATION, hasSize(adfgvxExplanation.size())))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_EXPLANATION, hasItems(adfgvxExplanation.get(0), adfgvxExplanation.get(1), adfgvxExplanation.get(2))))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_FACTS).isArray())
.andExpect(jsonPath(CipherInfoUtil.CIPHER_FACTS, hasSize(adfgvxFacts.size())))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_FACTS, hasItems(adfgvxFacts.get(0), adfgvxFacts.get(1), adfgvxFacts.get(2))));
//Filter
super.verifyFilter(url);

View File

@@ -3,6 +3,8 @@ package com.mattrixwv.cipherstream.controller.combination;
import static org.junit.jupiter.api.Assertions.*;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
@@ -32,17 +34,21 @@ public class AdfgvxCipherControllerTest{
private static final String OUTPUT_STRING = "AXgvdavfxgagfa afag-aaxdxfgdagda";
private static final String adfgvxName = "adfgvxName";
private static final String adfgvxDescription = "adfgvxDescription";
private static final List<String> adfgvxExplanation = List.of("adfgvxExplanation1", "adfgvxExplanation2", "adfgvxExplanation3");
private static final List<String> adfgvxFacts = List.of("adfgvxFact1", "adfgvxFact2", "adfgvxFact3");
@BeforeEach
public void setup(){
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxName", adfgvxName);
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxDescription", adfgvxDescription);
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxExplanation", adfgvxExplanation);
ReflectionTestUtils.setField(adfgvxCipherController, "adfgvxFacts", adfgvxFacts);
}
@Test
public void tetGetCipherInfo(){
ObjectNode infoNode = CipherInfoUtil.buildInfoNode(adfgvxName, adfgvxDescription);
ObjectNode infoNode = CipherInfoUtil.buildInfoNode(adfgvxName, adfgvxDescription, adfgvxExplanation, adfgvxFacts);
ObjectNode returnedJson = adfgvxCipherController.getCipherInfo();

View File

@@ -1,10 +1,13 @@
package com.mattrixwv.cipherstream.controller.combination;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
@@ -42,6 +45,8 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
private static final String squareKeyword = "SquareKeyword";
private static final String adfgxName = "adfgxName";
private static final String adfgxDescription = "adfgxDescription";
private static final List<String> adfgxExplanation = List.of("adfgxExplanation1", "adfgxExplanation2", "adfgxExplanation3");
private static final List<String> adfgxFacts = List.of("adfgxFact1", "adfgxFact2", "adfgxFact3");
@BeforeEach
@@ -66,6 +71,8 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
ReflectionTestUtils.setField(adfgxCipherController, "adfgxName", adfgxName);
ReflectionTestUtils.setField(adfgxCipherController, "adfgxDescription", adfgxDescription);
ReflectionTestUtils.setField(adfgxCipherController, "adfgxExplanation", adfgxExplanation);
ReflectionTestUtils.setField(adfgxCipherController, "adfgxFacts", adfgxFacts);
}
@@ -77,7 +84,13 @@ public class AdfgxCipherControllerIntegrationTest extends CipherStreamController
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_NAME).value(adfgxName))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_DESCRIPTION).value(adfgxDescription));
.andExpect(jsonPath(CipherInfoUtil.CIPHER_DESCRIPTION).value(adfgxDescription))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_EXPLANATION).isArray())
.andExpect(jsonPath(CipherInfoUtil.CIPHER_EXPLANATION, hasSize(adfgxExplanation.size())))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_EXPLANATION, hasItems(adfgxExplanation.get(0), adfgxExplanation.get(1), adfgxExplanation.get(2))))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_FACTS).isArray())
.andExpect(jsonPath(CipherInfoUtil.CIPHER_FACTS, hasSize(adfgxFacts.size())))
.andExpect(jsonPath(CipherInfoUtil.CIPHER_FACTS, hasItems(adfgxFacts.get(0), adfgxFacts.get(1), adfgxFacts.get(2))));
//Filter
super.verifyFilter(url);

View File

@@ -3,6 +3,8 @@ package com.mattrixwv.cipherstream.controller.combination;
import static org.junit.jupiter.api.Assertions.*;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
@@ -32,17 +34,21 @@ public class AdfgxCipherControllerTest{
private static final String ADFGX_OUTPUT_STRING = "AAgagadfagaxxd axdx^adafafxddgdf";
private static final String adfgxName = "adfgxName";
private static final String adfgxDescription = "adfgxDescription";
private static final List<String> adfgxExplanation = List.of("adfgxExplanation1", "adfgxExplanation2", "adfgxExplanation3");
private static final List<String> adfgxFacts = List.of("adfgxFact1", "adfgxFact2", "adfgxFact3");
@BeforeEach
public void setup(){
ReflectionTestUtils.setField(adfgxCipherController, "adfgxName", adfgxName);
ReflectionTestUtils.setField(adfgxCipherController, "adfgxDescription", adfgxDescription);
ReflectionTestUtils.setField(adfgxCipherController, "adfgxExplanation", adfgxExplanation);
ReflectionTestUtils.setField(adfgxCipherController, "adfgxFacts", adfgxFacts);
}
@Test
public void testGetCipherInfo(){
ObjectNode infoNode = CipherInfoUtil.buildInfoNode(adfgxName, adfgxDescription);
ObjectNode infoNode = CipherInfoUtil.buildInfoNode(adfgxName, adfgxDescription, adfgxExplanation, adfgxFacts);
ObjectNode returnedJson = adfgxCipherController.getCipherInfo();