Fix sonarqube warnings
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidScalarException.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 TestInvalidScalarException{
|
||||
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,22 +20,22 @@ public class TestInvalidScalarException{
|
||||
|
||||
@Test
|
||||
public void testConstructor_message(){
|
||||
InvalidScalarException exception = new InvalidScalarException(message);
|
||||
assertEquals(message, exception.getMessage());
|
||||
InvalidScalarException exception = new InvalidScalarException(MESSAGE);
|
||||
assertEquals(MESSAGE, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructor_cause(){
|
||||
InvalidScalarException exception = new InvalidScalarException(cause);
|
||||
assertEquals(cause.toString(), exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
InvalidScalarException exception = new InvalidScalarException(CAUSE);
|
||||
assertEquals(CAUSE.toString(), exception.getMessage());
|
||||
assertEquals(CAUSE, exception.getCause());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructor_messageCause(){
|
||||
InvalidScalarException exception = new InvalidScalarException(message, cause);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
InvalidScalarException exception = new InvalidScalarException(MESSAGE, CAUSE);
|
||||
assertEquals(MESSAGE, exception.getMessage());
|
||||
assertEquals(CAUSE, exception.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user