diff --git a/pom.xml b/pom.xml index 2e0858f..8f28fcc 100644 --- a/pom.xml +++ b/pom.xml @@ -150,7 +150,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.13.0 ${java.version} ${java.version} @@ -185,7 +185,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.12 diff --git a/src/test/java/be/sddevelopment/validation/specs/usage/BasicUsageTest.java b/src/test/java/be/sddevelopment/validation/specs/usage/BasicUsageTest.java index 4003288..b715d83 100644 --- a/src/test/java/be/sddevelopment/validation/specs/usage/BasicUsageTest.java +++ b/src/test/java/be/sddevelopment/validation/specs/usage/BasicUsageTest.java @@ -1,8 +1,6 @@ package be.sddevelopment.validation.specs.usage; -import be.sddevelopment.validation.core.Constraint; -import be.sddevelopment.validation.core.InvalidObjectException; -import be.sddevelopment.validation.core.ModularRuleset; +import be.sddevelopment.validation.core.*; import org.assertj.core.api.WithAssertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; @@ -39,8 +37,12 @@ void modularValidatorsMustCoverBasicUsage_givenSimpleDateBasedValidationLogic() .must(notBeNull) .must(haveNonNullField(DateBasedDummyObject::localDate), "have a non-null local date") .iHaveSpoken(); + Constrained constrained = validator.constrain(toValidate); - assertThat(validator.constrain(toValidate)).is(valid()); + assertThat(constrained).is(valid()); + assertThat(constrained) + .extracting(Constrained::rationale) + .matches(Rationale::isPassing); } private record DateBasedDummyObject(LocalDate localDate) { @@ -77,10 +79,10 @@ void checkedShouldAllowForFluentUsage_whenUsingItAsAGuard_givenInvalidObject() { @Test void allowsForFurtherProcessing() { - var toBeUsed = new DateBasedDummyObject("I have a name", LocalDate.of(2023, MARCH, 9)); var dateLoggingService = new DateLoggingService(); - assertThat(requirements().constrain(toBeUsed)).is(valid()); assertThat(dateLoggingService.logLines()).isEmpty(); + var toBeUsed = new DateBasedDummyObject("I have a name", LocalDate.of(2023, MARCH, 9)); + assertThat(requirements().constrain(toBeUsed)).is(valid()); requirements().constrain(toBeUsed) .extract(DateBasedDummyObject::localDate)