From 5461a503185de72e7a653ea7dac1aa0f34218733 Mon Sep 17 00:00:00 2001 From: Paolo Bizzarri Date: Thu, 29 Aug 2024 10:13:18 +0200 Subject: [PATCH] Replaces junit assertions with assertj assertions --- .../dmn/openapi/impl/DMNTypeSchemasTest.java | 60 +++++++++---------- .../openapi/impl/DMNUnaryTestsMapperTest.java | 53 +++++++--------- .../impl/FEELFunctionSchemaMapperTest.java | 6 +- .../impl/InfixOpNodeSchemaMapperTest.java | 7 ++- .../impl/RangeNodeSchemaMapperTest.java | 19 +++--- 5 files changed, 63 insertions(+), 82 deletions(-) diff --git a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNTypeSchemasTest.java b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNTypeSchemasTest.java index 1f6991ad8c6..90c94cb31bc 100644 --- a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNTypeSchemasTest.java +++ b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNTypeSchemasTest.java @@ -29,9 +29,7 @@ import org.kie.dmn.core.impl.SimpleTypeImpl; import org.kie.dmn.feel.lang.types.BuiltInType; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.FEEL_NUMBER; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.FEEL_STRING; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.getSchemaForSimpleType; @@ -49,25 +47,23 @@ void populateSchemaWithConstraintsForAllowedValues() { SimpleTypeImpl toRead = getSimpleType(allowedValuesString, null, FEEL_STRING, BuiltInType.STRING); AtomicReference toPopulate = new AtomicReference<>(getSchemaForSimpleType(toRead)); DMNTypeSchemas.populateSchemaWithConstraints(toPopulate.get(), toRead); - assertEquals(enumBase.size(), toPopulate.get().getEnumeration().size()); - enumBase.forEach(en -> assertTrue(toPopulate.get().getEnumeration().contains(en))); - assertTrue(toPopulate.get().getExtensions().containsKey(DMNOASConstants.X_DMN_ALLOWED_VALUES)); + assertThat(toPopulate.get().getEnumeration()).hasSameSizeAs(enumBase).containsAll(enumBase); + assertThat(toPopulate.get().getExtensions()).containsKey(DMNOASConstants.X_DMN_ALLOWED_VALUES); String retrieved = ((String) toPopulate.get().getExtensions().get(DMNOASConstants.X_DMN_ALLOWED_VALUES)).replace(" ", ""); - assertEquals(allowedValuesString, retrieved); + assertThat(retrieved).isEqualTo(allowedValuesString); - toEnum = Arrays.asList(1, 3, 6, 78); + toEnum = Arrays.asList(BigDecimal.valueOf(1), BigDecimal.valueOf(3), BigDecimal.valueOf(6), BigDecimal.valueOf(78)); allowedValuesString = String.join(",", toEnum.stream().map(toMap -> String.format("%s", toMap)).toList()); toRead = getSimpleType(allowedValuesString, null, FEEL_NUMBER, BuiltInType.NUMBER); toPopulate.set(getSchemaForSimpleType(toRead)); DMNTypeSchemas.populateSchemaWithConstraints(toPopulate.get(), toRead); - assertEquals(toEnum.size(), toPopulate.get().getEnumeration().size()); - toEnum.stream().map(i -> BigDecimal.valueOf((int) i)).forEach(en -> assertTrue(toPopulate.get().getEnumeration().contains(en))); - assertTrue(toPopulate.get().getExtensions().containsKey(DMNOASConstants.X_DMN_ALLOWED_VALUES)); + assertThat(toPopulate.get().getEnumeration()).hasSameSizeAs(toEnum).containsAll(toEnum); + assertThat(toPopulate.get().getExtensions()).containsKey(DMNOASConstants.X_DMN_ALLOWED_VALUES); retrieved = ((String) toPopulate.get().getExtensions().get(DMNOASConstants.X_DMN_ALLOWED_VALUES)).replace(" " , ""); - assertEquals(allowedValuesString, retrieved); + assertThat(retrieved).isEqualTo(allowedValuesString); } @Test @@ -80,26 +76,24 @@ void populateSchemaWithConstraintsForTypeConstraints() { SimpleTypeImpl toRead = getSimpleType(null, typeConstraintsString, FEEL_STRING, BuiltInType.STRING); AtomicReference toPopulate = new AtomicReference<>(getSchemaForSimpleType(toRead)); DMNTypeSchemas.populateSchemaWithConstraints(toPopulate.get(), toRead); - assertEquals(enumBase.size(), toPopulate.get().getEnumeration().size()); - enumBase.forEach(en -> assertTrue(toPopulate.get().getEnumeration().contains(en))); - assertTrue(toPopulate.get().getExtensions().containsKey(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS)); + assertThat(toPopulate.get().getEnumeration()).hasSameSizeAs(enumBase).containsAll(enumBase); + assertThat(toPopulate.get().getExtensions()).containsKey(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS); String retrieved = ((String) toPopulate.get().getExtensions().get(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS)).replace(" ", ""); - assertEquals(typeConstraintsString, retrieved); + assertThat(retrieved).isEqualTo(typeConstraintsString); - toEnum = Arrays.asList(1, 3, 6, 78); + toEnum = Arrays.asList(BigDecimal.valueOf(1), BigDecimal.valueOf(3), BigDecimal.valueOf(6), BigDecimal.valueOf(78)); typeConstraintsString = String.join(",", toEnum.stream().map(toMap -> String.format("%s", toMap)).toList()); toRead = getSimpleType(null, typeConstraintsString, FEEL_NUMBER, BuiltInType.NUMBER); toPopulate.set(getSchemaForSimpleType(toRead)); DMNTypeSchemas.populateSchemaWithConstraints(toPopulate.get(), toRead); - assertEquals(toEnum.size(), toPopulate.get().getEnumeration().size()); - toEnum.stream().map(i -> BigDecimal.valueOf((int) i)).forEach(en -> assertTrue(toPopulate.get().getEnumeration().contains(en))); - assertTrue(toPopulate.get().getExtensions().containsKey(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS)); + assertThat(toPopulate.get().getEnumeration()).hasSameSizeAs(toEnum).containsAll(toEnum); + assertThat(toPopulate.get().getExtensions()).containsKey(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS); retrieved = ((String) toPopulate.get().getExtensions().get(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS)).replace( " ", ""); - assertEquals(typeConstraintsString, retrieved); + assertThat(retrieved).isEqualTo(typeConstraintsString); } @Test @@ -110,15 +104,15 @@ void populateSchemaWithRangesForAllowedValues() { SimpleTypeImpl toRead = getSimpleType(allowedValuesString, null, FEEL_STRING, BuiltInType.STRING); AtomicReference toPopulate = new AtomicReference<>(getSchemaForSimpleType(toRead)); DMNTypeSchemas.populateSchemaWithConstraints(toPopulate.get(), toRead); - assertEquals(BigDecimal.ONE, toPopulate.get().getMinimum()); - assertTrue(toPopulate.get().getExclusiveMinimum()); - assertEquals(BigDecimal.TEN, toPopulate.get().getMaximum()); - assertFalse(toPopulate.get().getExclusiveMaximum()); - assertTrue(toPopulate.get().getExtensions().containsKey(DMNOASConstants.X_DMN_ALLOWED_VALUES)); + assertThat(toPopulate.get().getMinimum()).isEqualTo(BigDecimal.ONE); + assertThat(toPopulate.get().getExclusiveMinimum()).isTrue(); + assertThat(toPopulate.get().getMaximum()).isEqualTo(BigDecimal.TEN); + assertThat(toPopulate.get().getExclusiveMaximum()).isFalse(); + assertThat(toPopulate.get().getExtensions()).containsKey(DMNOASConstants.X_DMN_ALLOWED_VALUES); String retrieved = ((String) toPopulate.get().getExtensions().get(DMNOASConstants.X_DMN_ALLOWED_VALUES)).replace(" ", ""); String expected = allowedValuesString.replace("(", "").replace(")", ""); - assertEquals(expected, retrieved); + assertThat(retrieved).isEqualTo(expected); } @Test @@ -129,15 +123,15 @@ void populateSchemaWithRangesForTypeConstraints() { SimpleTypeImpl toRead = getSimpleType(null, typeConstraintsString, FEEL_STRING, BuiltInType.STRING); AtomicReference toPopulate = new AtomicReference<>(getSchemaForSimpleType(toRead)); DMNTypeSchemas.populateSchemaWithConstraints(toPopulate.get(), toRead); - assertEquals(BigDecimal.ONE, toPopulate.get().getMinimum()); - assertTrue(toPopulate.get().getExclusiveMinimum()); - assertEquals(BigDecimal.TEN, toPopulate.get().getMaximum()); - assertFalse(toPopulate.get().getExclusiveMaximum()); - assertTrue(toPopulate.get().getExtensions().containsKey(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS)); + assertThat(toPopulate.get().getMinimum()).isEqualTo(BigDecimal.ONE); + assertThat(toPopulate.get().getExclusiveMinimum()).isTrue(); + assertThat(toPopulate.get().getMaximum()).isEqualTo(BigDecimal.TEN); + assertThat(toPopulate.get().getExclusiveMaximum()).isFalse(); + assertThat(toPopulate.get().getExtensions().containsKey(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS)).isTrue(); String retrieved = ((String) toPopulate.get().getExtensions().get(DMNOASConstants.X_DMN_TYPE_CONSTRAINTS)).replace(" ", ""); String expected = typeConstraintsString.replace("(", "").replace(")", ""); - assertEquals(expected, retrieved); + assertThat(retrieved).isEqualTo(expected); } } \ No newline at end of file diff --git a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNUnaryTestsMapperTest.java b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNUnaryTestsMapperTest.java index c0951f69bde..90885ba04c0 100644 --- a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNUnaryTestsMapperTest.java +++ b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/DMNUnaryTestsMapperTest.java @@ -22,7 +22,6 @@ import java.time.LocalDate; import java.util.Arrays; import java.util.List; -import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -33,12 +32,8 @@ import org.kie.dmn.feel.lang.ast.BaseNode; import org.kie.dmn.feel.lang.types.BuiltInType; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.kie.dmn.openapi.impl.DMNUnaryTestsMapper.getUnaryEvaluationNodesFromUnaryTests; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.FEEL_NUMBER; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.FEEL_STRING; @@ -56,10 +51,9 @@ void populateSchemaFromUnaryTestsForEnumsWithoutNull() { expression += ", count (?) > 1"; List unaryTests = feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList(); DMNUnaryTestsMapper.populateSchemaFromUnaryTests(toPopulate, unaryTests); - assertFalse(toPopulate.getNullable()); - assertNotNull(toPopulate.getEnumeration()); - assertEquals(expectedStrings.size(), toPopulate.getEnumeration().size()); - expectedStrings.forEach(expectedString -> assertTrue(toPopulate.getEnumeration().contains(expectedString))); + assertThat(toPopulate.getNullable()).isFalse(); + assertThat(toPopulate.getEnumeration()).isNotNull(); + assertThat(toPopulate.getEnumeration()).hasSameSizeAs(expectedStrings).containsAll(expectedStrings); } @Test @@ -70,10 +64,9 @@ void populateSchemaFromUnaryTestsForEnumsWithNull() { String expression = String.join(",", toEnum.stream().map(toMap -> String.format("%s", toMap.toString())).toList()); List unaryTests = feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList(); DMNUnaryTestsMapper.populateSchemaFromUnaryTests(toPopulate, unaryTests); - assertTrue(toPopulate.getNullable()); - assertNotNull(toPopulate.getEnumeration()); - assertEquals(expectedStrings.size(), toPopulate.getEnumeration().size()); - expectedStrings.stream().filter(Objects::nonNull).forEach(expectedString -> assertTrue(toPopulate.getEnumeration().contains(expectedString))); + assertThat(toPopulate.getNullable()).isTrue(); + assertThat(toPopulate.getEnumeration()).isNotNull(); + assertThat(toPopulate.getEnumeration()).hasSameSizeAs(expectedStrings).containsAll(expectedStrings); } @Test @@ -83,19 +76,17 @@ void populateSchemaFromUnaryTestsForEnumSucceed() { String expression = String.join(",", toEnum.stream().map(toMap -> String.format("%s", toMap)).toList()); List toCheck = feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList(); AtomicReference toPopulate = new AtomicReference<>(getSchemaForSimpleType(null, expression, FEEL_STRING, BuiltInType.STRING)); - assertNull(toPopulate.get().getEnumeration()); + assertThat(toPopulate.get().getEnumeration()).isNull();; DMNUnaryTestsMapper.populateSchemaFromUnaryTests(toPopulate.get(), toCheck); - assertEquals(enumBase.size(), toPopulate.get().getEnumeration().size()); - enumBase.forEach(en -> assertTrue(toPopulate.get().getEnumeration().contains(en))); + assertThat(toPopulate.get().getEnumeration()).hasSameSizeAs(enumBase).containsAll(enumBase); - toEnum = Arrays.asList(1, 3, 6, 78); - expression = String.join(",", toEnum.stream().map(toMap -> String.format("%s", toMap)).toList()); + ListtoEnum1 = Arrays.asList(BigDecimal.valueOf(1L), BigDecimal.valueOf(3), BigDecimal.valueOf(6), BigDecimal.valueOf(78)); + expression = String.join(",", toEnum1.stream().map(toMap -> String.format("%s", toMap)).toList()); toCheck = feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList(); toPopulate.set(getSchemaForSimpleType(null, expression, FEEL_NUMBER, BuiltInType.NUMBER)); - assertNull(toPopulate.get().getEnumeration()); + assertThat(toPopulate.get().getEnumeration()).isNull(); DMNUnaryTestsMapper.populateSchemaFromUnaryTests(toPopulate.get(), toCheck); - assertEquals(toEnum.size(), toPopulate.get().getEnumeration().size()); - toEnum.stream().map(i -> BigDecimal.valueOf((int)i)).forEach(en -> assertTrue(toPopulate.get().getEnumeration().contains(en))); + assertThat(toPopulate.get().getEnumeration()).hasSameSizeAs(enumBase).extracting(value -> ((BigDecimal)value)).containsAll(toEnum1); toPopulate.set(OASFactory.createObject(Schema.class)); List expectedDates = Arrays.asList(LocalDate.of(2022, 1, 1), LocalDate.of(2024, 1, 1)); @@ -104,11 +95,10 @@ void populateSchemaFromUnaryTestsForEnumSucceed() { .toList(); expression = String.join(",", formattedDates.stream().map(toMap -> String.format("%s", toMap)).toList()); toCheck = feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList(); - assertNull(toPopulate.get().getNullable()); + assertThat(toPopulate.get().getNullable()).isNull(); DMNUnaryTestsMapper.populateSchemaFromUnaryTests(toPopulate.get(), toCheck); - assertNotNull(toPopulate.get().getEnumeration()); - assertEquals(expectedDates.size(), toPopulate.get().getEnumeration().size()); - expectedDates.forEach(expectedDate -> assertTrue(toPopulate.get().getEnumeration().contains(expectedDate))); + assertThat(toPopulate.get().getEnumeration()).isNotNull(); + assertThat(toPopulate.get().getEnumeration()).hasSameSizeAs(expectedDates).containsAll(expectedDates); } @Test @@ -117,9 +107,9 @@ void populateSchemaFromUnaryTestsFails() { String expression = String.join(",", toEnum.stream().map(toMap -> String.format("%s", toMap)).toList()); List toCheck = feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList(); - assertEquals(toEnum.size(), toCheck.size()); + assertThat(toCheck).hasSameSizeAs(toEnum); Schema toPopulate = getSchemaForSimpleType(null, expression, FEEL_STRING, BuiltInType.STRING); - assertThrows(IllegalArgumentException.class, () -> DMNUnaryTestsMapper.populateSchemaFromUnaryTests(toPopulate, toCheck)); + assertThatIllegalArgumentException().isThrownBy(() -> DMNUnaryTestsMapper.populateSchemaFromUnaryTests(toPopulate, toCheck)); } @Test @@ -130,11 +120,10 @@ void populateSchemaFromBaseNodeSucceed() { List dmnUnaryTests = feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList(); AtomicReference schemaRef = new AtomicReference<>(getSchemaForSimpleType(null, expression, FEEL_STRING, BuiltInType.STRING)); - assertNull(schemaRef.get().getEnumeration()); + assertThat(schemaRef.get().getEnumeration()).isNull(); BaseNode toCheck = getUnaryEvaluationNodesFromUnaryTests(dmnUnaryTests).get(0); DMNUnaryTestsMapper.populateSchemaFromBaseNode(schemaRef.get(), toCheck); - assertEquals(enumBase.size(), schemaRef.get().getEnumeration().size()); - enumBase.forEach(en -> assertTrue(schemaRef.get().getEnumeration().contains(en))); + assertThat(schemaRef.get().getEnumeration()).hasSameSizeAs(enumBase).containsAll(enumBase); } } \ No newline at end of file diff --git a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/FEELFunctionSchemaMapperTest.java b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/FEELFunctionSchemaMapperTest.java index 05b5566563f..03d90bf88e3 100644 --- a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/FEELFunctionSchemaMapperTest.java +++ b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/FEELFunctionSchemaMapperTest.java @@ -29,7 +29,7 @@ import org.kie.dmn.feel.lang.types.BuiltInType; import org.kie.dmn.feel.runtime.functions.CountFunction; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.assertj.core.api.Assertions.assertThat; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.FEEL_NUMBER; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.getSchemaForSimpleType; @@ -55,8 +55,8 @@ void populateSchemaFromFEELFunction(InfixOperator operator) { expectedMaximum = rightValue; } } - assertEquals(expectedMinimum, toPopulate.getMinItems()); - assertEquals(expectedMaximum, toPopulate.getMaxItems()); + assertThat(toPopulate.getMinItems()).isEqualTo(expectedMinimum); + assertThat(toPopulate.getMaxItems()).isEqualTo(expectedMaximum); }); } } \ No newline at end of file diff --git a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/InfixOpNodeSchemaMapperTest.java b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/InfixOpNodeSchemaMapperTest.java index 42e8e136abe..084e7fc2c30 100644 --- a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/InfixOpNodeSchemaMapperTest.java +++ b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/InfixOpNodeSchemaMapperTest.java @@ -29,7 +29,8 @@ import org.kie.dmn.feel.lang.types.BuiltInType; import org.kie.dmn.feel.runtime.functions.CountFunction; -import static org.junit.jupiter.api.Assertions.assertEquals; + +import static org.assertj.core.api.Assertions.assertThat; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.FEEL_NUMBER; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.getBaseNode; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.getSchemaForSimpleType; @@ -57,8 +58,8 @@ void populateSchemaFromFunctionInvocationNode(InfixOperator operator) { expectedMaximum = rightValue; } } - assertEquals(expectedMinimum, toPopulate.getMinItems()); - assertEquals(expectedMaximum, toPopulate.getMaxItems()); + assertThat(toPopulate.getMinItems()).isEqualTo(expectedMinimum); + assertThat(toPopulate.getMaxItems()).isEqualTo(expectedMaximum); }); } } \ No newline at end of file diff --git a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/RangeNodeSchemaMapperTest.java b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/RangeNodeSchemaMapperTest.java index a79c66b7ad3..d2c634f858b 100644 --- a/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/RangeNodeSchemaMapperTest.java +++ b/kie-dmn/kie-dmn-openapi/src/test/java/org/kie/dmn/openapi/impl/RangeNodeSchemaMapperTest.java @@ -33,9 +33,6 @@ import org.kie.dmn.feel.runtime.impl.RangeImpl; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.kie.dmn.openapi.impl.SchemaMapperTestUtils.getBaseNodes; class RangeNodeSchemaMapperTest { @@ -48,10 +45,10 @@ void evaluateUnaryTestsForNumberRange() { List ranges = getBaseNodes(toRange, RangeNode.class); Schema toPopulate = OASFactory.createObject(Schema.class); RangeNodeSchemaMapper.populateSchemaFromListOfRanges(toPopulate, ranges); - assertEquals(BigDecimal.ONE, toPopulate.getMinimum()); - assertTrue(toPopulate.getExclusiveMinimum()); - assertEquals(BigDecimal.TEN, toPopulate.getMaximum()); - assertFalse(toPopulate.getExclusiveMaximum()); + assertThat(toPopulate.getMinimum()).isEqualTo(BigDecimal.ONE); + assertThat(toPopulate.getExclusiveMinimum()).isTrue(); + assertThat(toPopulate.getMaximum()).isEqualTo(BigDecimal.TEN); + assertThat(toPopulate.getExclusiveMaximum()).isFalse(); } @Test @@ -66,10 +63,10 @@ void evaluateUnaryTestsForDateRange() { Schema toPopulate = OASFactory.createObject(Schema.class); RangeNodeSchemaMapper.populateSchemaFromListOfRanges(toPopulate, ranges); - assertEquals(expectedDates.get(0), toPopulate.getExtensions().get(DMNOASConstants.X_DMN_MINIMUM_VALUE)); - assertTrue(toPopulate.getExclusiveMinimum()); - assertEquals(expectedDates.get(1), toPopulate.getExtensions().get(DMNOASConstants.X_DMN_MAXIMUM_VALUE)); - assertFalse(toPopulate.getExclusiveMaximum()); + assertThat(toPopulate.getExtensions().get(DMNOASConstants.X_DMN_MINIMUM_VALUE)).isEqualTo(expectedDates.get(0)); + assertThat(toPopulate.getExclusiveMinimum()).isTrue(); + assertThat(toPopulate.getExtensions().get(DMNOASConstants.X_DMN_MAXIMUM_VALUE)).isEqualTo(expectedDates.get(1)); + assertThat(toPopulate.getExclusiveMaximum()).isFalse(); } @Test