ReflectionAssertions { public static ModePhase assertReflective() { return new ModePhase(); }  static ModePhase assertReflective(); static OperationPhase assertReflectiveThat(Object actual); static OperationPhase assertLenientThat(Object actual);  }
@TestFactory @DisplayName("Lenient Dates Equals") Stream<? extends DynamicNode> lenientDatesEquals() { return Stream.<Generator>of( this::nulls, this::simple, this::equivalence, this::overriddenEquals, this::collections, this::optionals, this::differentClasses, this::lenientOldDates, this::lenientJava8Dates ).map(generator -> generator.generate( sample -> assertReflective().withLenientDates() .that(sample.actual) .isEqualTo(sample.expected), sample -> assertFailing( () -> assertReflective().withLenientDates() .that(sample.actual) .isEqualTo(sample.expected) ) )); }
@TestFactory @DisplayName("Lenient Dates Not Equals") Stream<? extends DynamicNode> lenientDatesNotEquals() { return Stream.<Generator>of( this::nulls, this::simple, this::equivalence, this::overriddenEquals, this::collections, this::optionals, this::differentClasses, this::lenientOldDates, this::lenientJava8Dates ).map(generator -> generator.generate( sample -> assertFailing( () -> assertReflective().withLenientDates() .that(sample.actual) .isNotEqualTo(sample.expected) ), sample -> assertReflective().withLenientDates() .that(sample.actual) .isNotEqualTo(sample.expected) )); }
@TestFactory @DisplayName("Ignore Default Equals") Stream<? extends DynamicNode> ignoreDefaultsEquals() { return Stream.<Generator>of( this::simple, this::equivalence, this::overriddenEquals, this::collections, this::differentClasses, this::withDefaults ).map(generator -> generator.generate( sample -> assertReflective().withIgnoreDefaults() .that(sample.actual) .isEqualTo(sample.expected), sample -> assertFailing( () -> assertReflective().withIgnoreDefaults() .that(sample.actual) .isEqualTo(sample.expected) ) )); }
@TestFactory @DisplayName("Ignore Default Not Equals") Stream<? extends DynamicNode> ignoreDefaultsNotEquals() { return Stream.<Generator>of( this::simple, this::equivalence, this::overriddenEquals, this::collections, this::differentClasses, this::withDefaults ).map(generator -> generator.generate( sample -> assertFailing( () -> assertReflective().withIgnoreDefaults() .that(sample.actual) .isNotEqualTo(sample.expected) ), sample -> assertReflective().withIgnoreDefaults() .that(sample.actual) .isNotEqualTo(sample.expected) )); }
@TestFactory @DisplayName("Complex Mode Equals") Stream<? extends DynamicNode> complexModesEquals() { return Stream.<Generator>of( this::simple, this::equivalence, this::overriddenEquals, this::collections, this::lenientOrderCollections, this::differentClasses, this::withDefaults ).map(generator -> generator.generate( sample -> assertReflective() .withLenientDates() .withLenientOrder() .withIgnoreDefaults() .that(sample.actual) .isEqualTo(sample.expected), sample -> assertFailing( () -> assertReflective() .withLenientDates() .withLenientOrder() .withIgnoreDefaults() .that(sample.actual) .isEqualTo(sample.expected) ) )); }
@TestFactory @DisplayName("Complex Mode Not Equals") Stream<? extends DynamicNode> complexModesNotEquals() { return Stream.<Generator>of( this::simple, this::equivalence, this::overriddenEquals, this::collections, this::lenientOrderCollections, this::differentClasses, this::withDefaults ).map(generator -> generator.generate( sample -> assertFailing( () -> assertReflective() .withLenientDates() .withLenientOrder() .withIgnoreDefaults() .that(sample.actual) .isNotEqualTo(sample.expected) ), sample -> assertReflective() .withLenientDates() .withLenientOrder() .withIgnoreDefaults() .that(sample.actual) .isNotEqualTo(sample.expected) )); }