Sonarqube fixes
This commit is contained in:
@@ -272,7 +272,7 @@ public class Columnar{
|
||||
|
||||
//Save and return the output
|
||||
outputString = output.toString();
|
||||
logger.debug("Output string '{}'", output.toString());
|
||||
logger.debug("Output string '{}'", outputString);
|
||||
}
|
||||
protected void createOutputStringFromRows(){
|
||||
logger.debug("Creating output string for decoding");
|
||||
|
||||
@@ -193,8 +193,9 @@ public class Hill{
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("Polished string '{}'", outputBuilder.toString());
|
||||
return outputBuilder.toString();
|
||||
String cleanString = outputBuilder.toString();
|
||||
logger.debug("Polished string '{}'", cleanString);
|
||||
return cleanString;
|
||||
}
|
||||
protected ArrayList<ModMatrix> getInputVectors(){
|
||||
logger.debug("Generating input vectors");
|
||||
|
||||
@@ -157,8 +157,10 @@ public class TestHill{
|
||||
|
||||
@Test
|
||||
public void testSetKey_invalidMod(){
|
||||
ModMatrix matrix = new ModMatrix(keyArray, 30);
|
||||
|
||||
assertThrows(InvalidKeyException.class, () -> {
|
||||
cipher.setKey(new ModMatrix(keyArray, 30));
|
||||
cipher.setKey(matrix);
|
||||
});
|
||||
|
||||
assertEquals(new ModMatrix(26), cipher.key);
|
||||
@@ -171,8 +173,10 @@ public class TestHill{
|
||||
|
||||
@Test
|
||||
public void testSetKey_NotSquare(){
|
||||
ModMatrix matrix = new ModMatrix(new int[][]{{10, 11}}, 26);
|
||||
|
||||
assertThrows(InvalidKeyException.class, () -> {
|
||||
cipher.setKey(new ModMatrix(new int[][]{{10, 11}}, 26));
|
||||
cipher.setKey(matrix);
|
||||
});
|
||||
|
||||
assertEquals(new ModMatrix(26), cipher.key);
|
||||
@@ -185,8 +189,10 @@ public class TestHill{
|
||||
|
||||
@Test
|
||||
public void testSetKey_notInvertable(){
|
||||
ModMatrix matrix = new ModMatrix(new int[][]{{10, 11}, {12, 13}}, 26);
|
||||
|
||||
assertThrows(InvalidKeyException.class, () -> {
|
||||
cipher.setKey(new ModMatrix(new int[][]{{10, 11}, {12, 13}}, 26));
|
||||
cipher.setKey(matrix);
|
||||
});
|
||||
|
||||
assertEquals(new ModMatrix(26), cipher.key);
|
||||
|
||||
Reference in New Issue
Block a user