This is an automated email from the ASF dual-hosted git repository.
pibizza pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git
The following commit(s) were added to refs/heads/main by this push:
new 2fcc0e5dbc Replaces junit assertions with assertj assertions (#6057)
2fcc0e5dbc is described below
commit 2fcc0e5dbc591d9cdc565adc04479e8ad27fa68b
Author: Paolo Bizzarri <[email protected]>
AuthorDate: Tue Sep 3 14:43:53 2024 +0200
Replaces junit assertions with assertj assertions (#6057)
---
.../kie/dmn/openapi/impl/DMNTypeSchemasTest.java | 60 ++++++++++------------
.../dmn/openapi/impl/DMNUnaryTestsMapperTest.java | 53 ++++++++-----------
.../openapi/impl/FEELFunctionSchemaMapperTest.java | 6 +--
.../openapi/impl/InfixOpNodeSchemaMapperTest.java | 7 +--
.../openapi/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 1f6991ad8c..90c94cb31b 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.junit.jupiter.api.Test;
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 @@ class DMNTypeSchemasTest {
SimpleTypeImpl toRead = getSimpleType(allowedValuesString, null,
FEEL_STRING, BuiltInType.STRING);
AtomicReference<Schema> 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 @@ class DMNTypeSchemasTest {
SimpleTypeImpl toRead = getSimpleType(null, typeConstraintsString,
FEEL_STRING, BuiltInType.STRING);
AtomicReference<Schema> 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 @@ class DMNTypeSchemasTest {
SimpleTypeImpl toRead = getSimpleType(allowedValuesString, null,
FEEL_STRING, BuiltInType.STRING);
AtomicReference<Schema> 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 @@ class DMNTypeSchemasTest {
SimpleTypeImpl toRead = getSimpleType(null, typeConstraintsString,
FEEL_STRING, BuiltInType.STRING);
AtomicReference<Schema> 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 c0951f69bd..90885ba04c 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.math.BigDecimal;
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.api.core.DMNUnaryTest;
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 @@ class DMNUnaryTestsMapperTest {
expression += ", count (?) > 1";
List<DMNUnaryTest> 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 @@ class DMNUnaryTestsMapperTest {
String expression = String.join(",", toEnum.stream().map(toMap ->
String.format("%s", toMap.toString())).toList());
List<DMNUnaryTest> 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 @@ class DMNUnaryTestsMapperTest {
String expression = String.join(",", toEnum.stream().map(toMap ->
String.format("%s", toMap)).toList());
List<DMNUnaryTest> toCheck =
feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList();
AtomicReference<Schema> 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());
+ List<BigDecimal>toEnum1 = 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<LocalDate> expectedDates = Arrays.asList(LocalDate.of(2022, 1,
1), LocalDate.of(2024, 1, 1));
@@ -104,11 +95,10 @@ class DMNUnaryTestsMapperTest {
.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 @@ class DMNUnaryTestsMapperTest {
String expression = String.join(",", toEnum.stream().map(toMap ->
String.format("%s", toMap)).toList());
List<DMNUnaryTest> 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 @@ class DMNUnaryTestsMapperTest {
List<DMNUnaryTest> dmnUnaryTests =
feel.evaluateUnaryTests(expression).stream().map(DMNUnaryTest.class::cast).toList();
AtomicReference<Schema> 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 05b5566563..03d90bf88e 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.ast.InfixOperator;
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 @@ class FEELFunctionSchemaMapperTest {
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 42e8e136ab..084e7fc2c3 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.ast.InfixOperator;
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 @@ class InfixOpNodeSchemaMapperTest {
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 a79c66b7ad..d2c634f858 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.Range;
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 @@ class RangeNodeSchemaMapperTest {
List<RangeNode> 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 @@ class RangeNodeSchemaMapperTest {
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]