1

fix tests

This commit is contained in:
Christoph
2020-04-09 18:40:56 +02:00
parent 1dd0708377
commit 647dc06c8c
3 changed files with 4 additions and 6 deletions

View File

@ -23,7 +23,8 @@ class ControllerTest {
public static final ArchRule controllerClassesShouldHaveControllerInName = classes()
.that().areAnnotatedWith(Controller.class)
.or().areAnnotatedWith(RestController.class)
.should().haveSimpleNameEndingWith("Controller");
.should().haveSimpleNameEndingWith("Controller")
.orShould().haveSimpleNameEndingWith("ControllerAdvice");
@ArchTest
public static final ArchRule controllerClassesShouldBeInControllerPackage = classes()
@ -34,7 +35,8 @@ class ControllerTest {
@ArchTest
public static final ArchRule classesInControllerPackageShouldHaveControllerInName = classes()
.that().resideInAPackage("..controller..")
.should().haveSimpleNameEndingWith("Controller");
.should().haveSimpleNameEndingWith("Controller")
.orShould().haveSimpleNameEndingWith("ControllerAdvice");
@ArchTest
public static final ArchRule controllerClassesShouldNotDependOnEachOther = noClasses()

View File

@ -26,11 +26,9 @@ class UpdateGroupDescriptionEventTest {
void applyEvent_badDescription() {
Event createEvent = createPublicGroupEvent(uuidMock(0));
Event updateEventA = new UpdateGroupDescriptionEvent(uuidMock(0), "A", "");
Event updateEventB = new UpdateGroupDescriptionEvent(uuidMock(0), "A", " ");
Group group = TestBuilder.apply(createEvent);
assertThrows(BadParameterException.class, () -> updateEventA.apply(group));
assertThrows(BadParameterException.class, () -> updateEventB.apply(group));
}
}

View File

@ -26,11 +26,9 @@ class UpdateGroupTitleEventTest {
void applyEvent_badDescription() {
Event createEvent = createPublicGroupEvent(uuidMock(0));
Event updateEventA = new UpdateGroupTitleEvent(uuidMock(0), "A", "");
Event updateEventB = new UpdateGroupTitleEvent(uuidMock(0), "A", " ");
Group group = TestBuilder.apply(createEvent);
assertThrows(BadParameterException.class, () -> updateEventA.apply(group));
assertThrows(BadParameterException.class, () -> updateEventB.apply(group));
}
}