Fix sonarqube warnings

This commit is contained in:
Matthew Ellison
2026-01-26 16:21:57 -05:00
parent 324d611910
commit e1e121b879
11 changed files with 573 additions and 1017 deletions

View File

@@ -1,7 +1,3 @@
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestNullMatrixException.java
//Mattrixwv
// Created: 04-13-23
//Modified: 08-11-24
package com.mattrixwv.matrix.exceptions;
@@ -11,8 +7,8 @@ import org.junit.jupiter.api.Test;
public class TestNullMatrixException{
private static final String message = "message";
private static final Throwable cause = new Exception();
private static final String MESSAGE = "message";
private static final Throwable CAUSE = new Exception();
@Test
@@ -24,21 +20,21 @@ public class TestNullMatrixException{
@Test
public void testConstructor_message(){
NullMatrixException exception = new NullMatrixException(message);
assertEquals(message, exception.getMessage());
NullMatrixException exception = new NullMatrixException(MESSAGE);
assertEquals(MESSAGE, exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_cause(){
NullMatrixException exception = new NullMatrixException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
NullMatrixException exception = new NullMatrixException(CAUSE);
assertEquals(CAUSE.toString(), exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
@Test
public void testConstructor_messageCause(){
NullMatrixException exception = new NullMatrixException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
NullMatrixException exception = new NullMatrixException(MESSAGE, CAUSE);
assertEquals(MESSAGE, exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
}