diff --git a/src/test/java/be/sddevelopment/validation/core/ConstrainedTest.java b/src/test/java/be/sddevelopment/validation/core/ConstrainedTest.java index a0442a0..8affbf3 100644 --- a/src/test/java/be/sddevelopment/validation/core/ConstrainedTest.java +++ b/src/test/java/be/sddevelopment/validation/core/ConstrainedTest.java @@ -1,7 +1,9 @@ package be.sddevelopment.validation.core; +import be.sddevelopment.commons.testing.naming.ReplaceUnderscoredCamelCasing; import org.assertj.core.api.WithAssertions; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.platform.commons.util.StringUtils; @@ -21,10 +23,11 @@ @DisplayName("Constrainables") @ExtendWith({MockitoExtension.class}) +@DisplayNameGeneration(ReplaceUnderscoredCamelCasing.class) class ConstrainedTest implements WithAssertions { @Test - void givenValidData_whenApplyingRule_itsEvaluationIsRemembered() { + void ruleEvaluationResultIsRetained_givenValidData_whenApplyingRule() { var contentToCheck = "This is a non empty String"; var rule = new Constraint<>(Predicate.not(String::isBlank), "mustn't be blank"); assertThat(rule.rule().test(contentToCheck)).isTrue(); @@ -38,7 +41,7 @@ void givenValidData_whenApplyingRule_itsEvaluationIsRemembered() { } @Test - void givenInvalidData_whenApplyingRule_itIsEvaluatedAsInvalid() { + void ruleEvaluationResultIsInvalid_givenInvalidData_whenApplyingRule() { var empty = ""; var rule = new Constraint<>(Predicate.not(String::isBlank), "mustn't be blank"); assertThat(rule.rule().test(empty)).isFalse(); @@ -73,7 +76,7 @@ void feedback_hasNoEffect_givenValidSourceData() { } @Test - void ifValid_givenTheDateIsValid_CallsTheProvidedConsumer() { + void callsAProvidedConsumer_givenTheDataIsValid() { var checked = constrain("I am a real String").adheresTo(Constraints.isNotEmpty()); var consumer = new MessageStore(); assertThat(checked).is(valid()); diff --git a/src/test/java/be/sddevelopment/validation/core/ConstraintTest.java b/src/test/java/be/sddevelopment/validation/core/ConstraintTest.java index 30b576a..1bfcdca 100644 --- a/src/test/java/be/sddevelopment/validation/core/ConstraintTest.java +++ b/src/test/java/be/sddevelopment/validation/core/ConstraintTest.java @@ -1,8 +1,10 @@ package be.sddevelopment.validation.core; +import be.sddevelopment.commons.testing.naming.ReplaceUnderscoredCamelCasing; import be.sddevelopment.validation.CheckedTestUtils; import org.assertj.core.api.WithAssertions; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.Test; import org.junit.platform.commons.util.StringUtils; @@ -14,6 +16,7 @@ import static be.sddevelopment.validation.core.Reason.passed; @DisplayName("Constraints / Rules") +@DisplayNameGeneration(ReplaceUnderscoredCamelCasing.class) class ConstraintTest implements WithAssertions { @Test diff --git a/src/test/java/be/sddevelopment/validation/core/ContrainsTest.java b/src/test/java/be/sddevelopment/validation/core/ContraintsTest.java similarity index 62% rename from src/test/java/be/sddevelopment/validation/core/ContrainsTest.java rename to src/test/java/be/sddevelopment/validation/core/ContraintsTest.java index 3247c4a..9a21978 100644 --- a/src/test/java/be/sddevelopment/validation/core/ContrainsTest.java +++ b/src/test/java/be/sddevelopment/validation/core/ContraintsTest.java @@ -1,16 +1,19 @@ package be.sddevelopment.validation.core; +import be.sddevelopment.commons.testing.naming.ReplaceUnderscoredCamelCasing; import org.assertj.core.api.WithAssertions; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.Test; import static be.sddevelopment.validation.core.Checks.haveNonNullField; @DisplayName("Constraints utility class") -class ContrainsTest implements WithAssertions { +@DisplayNameGeneration(ReplaceUnderscoredCamelCasing.class) +class ContraintsTest implements WithAssertions { @Test - void givenAnObjectWithANullField_havingNonNullFieldPredicate_fails() { + void validationFails_givenAnObjectWithANullField_andUsingNonNullFieldPredicate() { var toValidate = new DataObject(null); var rule = haveNonNullField(DataObject::content); @@ -18,7 +21,7 @@ void givenAnObjectWithANullField_havingNonNullFieldPredicate_fails() { } @Test - void givenAnObjectWithNoNullField_havingNonNullFieldPredicate_succeeds() { + void validationSucceeds_givenAnObjectWithNoNullField_andUsingNonNullFieldPredicate() { var toValidate = new DataObject("Some content"); var rule = haveNonNullField(DataObject::content); diff --git a/src/test/java/be/sddevelopment/validation/core/InvalidObjectExceptionTest.java b/src/test/java/be/sddevelopment/validation/core/InvalidObjectExceptionTest.java index 3d51e20..5f5c5d9 100644 --- a/src/test/java/be/sddevelopment/validation/core/InvalidObjectExceptionTest.java +++ b/src/test/java/be/sddevelopment/validation/core/InvalidObjectExceptionTest.java @@ -1,13 +1,16 @@ package be.sddevelopment.validation.core; +import be.sddevelopment.commons.testing.naming.ReplaceUnderscoredCamelCasing; import org.assertj.core.api.WithAssertions; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.Test; import static be.sddevelopment.validation.core.Reason.failed; import static be.sddevelopment.validation.core.Reason.passed; @DisplayName("InvalidObject Exceptions") +@DisplayNameGeneration(ReplaceUnderscoredCamelCasing.class) class InvalidObjectExceptionTest implements WithAssertions { @Test 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 5ffd245..ecbdfbd 100644 --- a/src/test/java/be/sddevelopment/validation/specs/usage/BasicUsageTest.java +++ b/src/test/java/be/sddevelopment/validation/specs/usage/BasicUsageTest.java @@ -1,5 +1,6 @@ package be.sddevelopment.validation.specs.usage; +import be.sddevelopment.commons.testing.naming.ReplaceUnderscoredCamelCasing; import be.sddevelopment.validation.core.*; import com.google.common.collect.ImmutableList; import org.apache.commons.lang3.StringUtils; @@ -27,6 +28,7 @@ import static org.apache.commons.lang3.StringUtils.containsIgnoreCase; @DisplayName("Basic Usage") +@DisplayNameGeneration(ReplaceUnderscoredCamelCasing.class) class BasicUsageTest implements WithAssertions { @Nested @@ -85,7 +87,7 @@ private record EmailContact(UUID userIdentifier, String email, String name, Stri } @Nested - @DisplayName("Constrained objects should allow for fluent usage") + @DisplayName("Constrained objects allow for fluent usage") class ConstrainedUsage { private static final ModularRuleset DATE_REQUIREMENTS = aValid(ConstrainedUsage.DateBasedDummyObject.class) .must(Objects::nonNull, "not be null")