@AnalyzeClasses(packagesOf = Main.class)
public class AggregateRulesJUnit5Test {
@ArchTest
static final ArchRule onlyAggregateRootsArePublic = classes()
.that()
.areNotAnnotatedWith(AggregateRoot.class)
.and()
.resideInAPackage("..domain..")
.should()
.notBePublic()
.because("the implementation of an aggregate " +
"should be hidden");
}