Skip to content

Instantly share code, notes, and snippets.

@aconstantin
Created February 3, 2022 20:15
Show Gist options
  • Save aconstantin/757c2413cdb6bef42fe479aa8e63f94f to your computer and use it in GitHub Desktop.
Save aconstantin/757c2413cdb6bef42fe479aa8e63f94f to your computer and use it in GitHub Desktop.
@ArchTest
public static final ArchRule exercise2 =
classes().that().haveSimpleNameEndingWith("Service")
.and()
.implement(HasName.Predicates.nameEndingWith("UseCase"))
.should().beAnnotatedWith(UseCase.class);
@ArchTest
public static final ArchRule exercise2a =
classes().that().haveSimpleNameEndingWith("Service")
.and()
.doNotImplement(HasName.Predicates.nameEndingWith("UseCase"))
.should().notBeAnnotatedWith(UseCase.class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment