Skip to content

AggregateRoots are the only public Entities - ArchUnit #184

@themassiveone

Description

@themassiveone
@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");

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions