Skip to content

Instantly share code, notes, and snippets.

@BenjaminKlatt
Last active October 12, 2020 21:30
Show Gist options
  • Save BenjaminKlatt/4008cd5849dedaa0c1983302b6823a59 to your computer and use it in GitHub Desktop.
Save BenjaminKlatt/4008cd5849dedaa0c1983302b6823a59 to your computer and use it in GitHub Desktop.
ArchUnit Freeze Feature
# store location
freeze.store.default.path=src/test/resources/frozen
# allow creation of a new violation store (default: false)
freeze.store.default.allowStoreCreation=true
@ArchTest
private static ArchRule controllers_should_be_suffixed =
freeze(
classes()
.that().areAnnotatedWith(RestController.class)
.should().haveSimpleNameEndingWith("Controller")
.andShould().resideInAPackage("..controller..")
.because("controllers must use business services instead of the persistence layer")
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment