Update cipher descriptions

This commit is contained in:
2024-04-22 00:03:36 -04:00
parent f40d18e54c
commit 71c50f0608
66 changed files with 1317 additions and 599 deletions

View File

@@ -3,11 +3,13 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.test.util.ReflectionTestUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
@@ -25,15 +27,24 @@ public class HillCipherControllerTest{
private HillCipherController hillCipherController;
//Fields
private static final ObjectMapper mapper = new ObjectMapper();
private static final ObjectNode blankNode = mapper.createObjectNode();
private static final String HILL_INPUT_STRING = "Message to^encode";
private static final String HILL_OUTPUT_STRING = "Mgkeqge ul^ikhisp";
private static final int[][] KEY = {{1, 4, 2}, {2, 4, 1}, {4, 1, 2}};
private static final ObjectNode blankNode = mapper.createObjectNode();
private static final String hillName = "hillName";
private static final String hillDescription = "hillDescription";
@BeforeEach
public void setup(){
ReflectionTestUtils.setField(hillCipherController, "hillName", hillName);
ReflectionTestUtils.setField(hillCipherController, "hillDescription", hillDescription);
}
@Test
public void tetGetCipherInfo(){
ObjectNode infoNode = CipherInfoUtil.buildInfoNode(CipherInfoUtil.HILL_CIPHER_NAME, CipherInfoUtil.HILL_CIPHER_DESCRIPTION);
ObjectNode infoNode = CipherInfoUtil.buildInfoNode(hillName, hillDescription);
ObjectNode returnedJson = hillCipherController.getCipherInfo();