diff --git a/src/main/java/net/coru/kloadgen/randomtool/random/RandomSequence.java b/src/main/java/net/coru/kloadgen/randomtool/random/RandomSequence.java index 69902089..7bdc536e 100644 --- a/src/main/java/net/coru/kloadgen/randomtool/random/RandomSequence.java +++ b/src/main/java/net/coru/kloadgen/randomtool/random/RandomSequence.java @@ -45,7 +45,7 @@ public static Object generateSeq(final String fieldName, final String fieldType, } private static Object getFirstValueOrDefaultForType(final List fieldValueList, final String fieldType) { - Object result; + final Object result; if (!fieldValueList.isEmpty()) { result = ValueUtils.castValue(fieldValueList.get(0), fieldType); } else { diff --git a/src/test/java/net/coru/kloadgen/randomtool/random/RandomSequenceTest.java b/src/test/java/net/coru/kloadgen/randomtool/random/RandomSequenceTest.java index 6d8f6c6f..430679b4 100644 --- a/src/test/java/net/coru/kloadgen/randomtool/random/RandomSequenceTest.java +++ b/src/test/java/net/coru/kloadgen/randomtool/random/RandomSequenceTest.java @@ -10,8 +10,7 @@ import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; +import org.junit.jupiter.api.Assertions; import java.math.BigDecimal; import java.util.ArrayList; @@ -54,7 +53,7 @@ private static Stream parametersForGenerateRandomValueWithList() { @DisplayName("Testing Generate a Random Value With a List of Values") @MethodSource("parametersForGenerateRandomValueWithList") void testGenerateRandomValueWithList(final int size, final List values) { - Exception exception = assertThrows(IllegalArgumentException.class, () -> { + final Exception exception = Assertions.assertThrows(IllegalArgumentException.class, () -> { final var intList = new ArrayList<>(); final var context = new HashMap(); for (int i=0; i <= size; i++) { @@ -62,9 +61,9 @@ void testGenerateRandomValueWithList(final int size, final List values) } }); - String expectedMessage = "Sequences do not accept more than one option as initial value"; - String actualMessage = exception.getMessage(); + final String expectedMessage = "Sequences do not accept more than one option as initial value"; + final String actualMessage = exception.getMessage(); - assertTrue(actualMessage.contains(expectedMessage)); + Assertions.assertTrue(actualMessage.contains(expectedMessage)); } } \ No newline at end of file