Skip to content

Commit dcfd8a4

Browse files
committed
move tests
1 parent 189ec21 commit dcfd8a4

1 file changed

Lines changed: 38 additions & 37 deletions

File tree

src/test/java/it/aboutbits/springboot/testing/validation/ValidationAssertTest.java

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -617,51 +617,52 @@ void givenNotValidatedClass_shouldAlwaysFail() {
617617
).isEnabled()
618618
);
619619
}
620+
}
620621

621-
@Test
622-
void shouldAlsoWorkForExtendedClassesEvenWithoutAllArgsConstructors() {
623-
var item = new SomeExtendingClass();
624-
item.notNull = "notNull";
625-
item.notNullPositiveOrZero = ScaledBigDecimal.ONE;
622+
@Test
623+
void shouldAlsoWorkForExtendedClassesEvenWithoutAllArgsConstructors() {
624+
var item = new SomeExtendingClass();
625+
item.notNull = "notNull";
626+
item.notNullPositiveOrZero = ScaledBigDecimal.ONE;
626627

627-
assertThatValidation().of(item)
628-
.usingBeanValidation()
629-
.notNull("notNull")
630-
.notNull("notNull")
631-
.positiveOrZero("notNullPositiveOrZero")
632-
.isCompliant();
628+
assertThatValidation().of(item)
629+
.usingBeanValidation()
630+
.notNull("notNull")
631+
.notNull("notNull")
632+
.positiveOrZero("notNullPositiveOrZero")
633+
.isCompliant();
633634

634-
var invalidItem = new SomeExtendingClass();
635+
var invalidItem = new SomeExtendingClass();
635636

636-
assertThatExceptionOfType(AssertionError.class).isThrownBy(
637-
() -> assertThatValidation().of(invalidItem)
638-
.usingBeanValidation()
639-
.notNull("notNull")
640-
.notNull("notNull")
641-
.positiveOrZero("notNullPositiveOrZero")
642-
.isCompliant()
643-
);
644-
}
637+
assertThatExceptionOfType(AssertionError.class).isThrownBy(
638+
() -> assertThatValidation().of(invalidItem)
639+
.usingBeanValidation()
640+
.notNull("notNull")
641+
.notNull("notNull")
642+
.positiveOrZero("notNullPositiveOrZero")
643+
.isCompliant()
644+
);
645+
}
645646

646-
@Test
647-
void usingRuleRegistrarShouldWork() {
648-
var item = new SomeExtendingClass();
649-
item.notNull = "notNull";
650-
item.notNullPositiveOrZero = ScaledBigDecimal.ONE;
651-
652-
Consumer<TestValidationAssert.TestRuleBuilder> registrar = (ruleBuilder -> ruleBuilder
653-
.notNull("notNull")
654-
.notNull("notNull")
655-
.positiveOrZero("notNullPositiveOrZero")
656-
);
647+
@Test
648+
void usingRuleRegistrarShouldWork() {
649+
var item = new SomeExtendingClass();
650+
item.notNull = "notNull";
651+
item.notNullPositiveOrZero = ScaledBigDecimal.ONE;
652+
653+
Consumer<TestValidationAssert.TestRuleBuilder> registrar = (ruleBuilder -> ruleBuilder
654+
.notNull("notNull")
655+
.notNull("notNull")
656+
.positiveOrZero("notNullPositiveOrZero")
657+
);
657658

658-
assertThatValidation().of(item)
659-
.usingBeanValidation()
660-
.withAdditionalRules(registrar)
661-
.isCompliant();
662-
}
659+
assertThatValidation().of(item)
660+
.usingBeanValidation()
661+
.withAdditionalRules(registrar)
662+
.isCompliant();
663663
}
664664

665+
665666
private static SomeValidParameter getSomeValidParameter() {
666667
return new SomeValidParameter(
667668
// NotNull

0 commit comments

Comments
 (0)