Fix sonarqube issues

This commit is contained in:
2026-01-26 22:23:05 -05:00
parent 1943f19b4e
commit 8e41b0a2ad
34 changed files with 1885 additions and 2081 deletions

View File

@@ -1,7 +1,3 @@
//CipherStreamJava/src/test/java/com/mattrixwv/cipherstream/exception/TestInvalidInputException.java
//Mattrixwv
// Created: 04-14-23
//Modified: 04-19-24
package com.mattrixwv.cipherstream.exceptions;
@@ -11,8 +7,8 @@ import org.junit.jupiter.api.Test;
public class InvalidInputExceptionTest{
private String message = "message";
private Throwable cause = new Exception();
private static final String MESSAGE = "message";
private static final Throwable CAUSE = new Exception();
@Test
@@ -24,22 +20,22 @@ public class InvalidInputExceptionTest{
@Test
public void testConstructor_message(){
InvalidInputException exception = new InvalidInputException(message);
assertEquals(message, exception.getMessage());
InvalidInputException exception = new InvalidInputException(MESSAGE);
assertEquals(MESSAGE, exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_cause(){
InvalidInputException exception = new InvalidInputException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
InvalidInputException exception = new InvalidInputException(CAUSE);
assertEquals(CAUSE.toString(), exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
@Test
public void testConstructor_messageAndCause(){
InvalidInputException exception = new InvalidInputException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
InvalidInputException exception = new InvalidInputException(MESSAGE, CAUSE);
assertEquals(MESSAGE, exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
}