Skip to content

Commit

Permalink
New archunit test to verify that shared package only contains shared …
Browse files Browse the repository at this point in the history
…kernels
  • Loading branch information
murdos committed Apr 22, 2024
1 parent 831fc84 commit e2c0741
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,23 @@ class HexagonalArchTest {
}
}

@Nested
class SharedKernels {
@Test
void sharedPackageShouldOnlyContainSharedKernels() {
classes()
.that()
.haveSimpleName("package-info")
.and()
.resideInAPackage(ROOT_PACKAGE.concat(".shared.."))
.should()
.beMetaAnnotatedWith(SharedKernel.class)
.because(ROOT_PACKAGE + ".shared package should only contain shared kernels")
.check(classes);
}
}

@Nested
class Wire {
Expand Down
17 changes: 17 additions & 0 deletions src/test/java/tech/jhipster/lite/HexagonalArchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,23 @@ void shouldNotDependOnSameContextPrimary() {
}
}

@Nested
class SharedKernels {

@Test
void sharedPackageShouldOnlyContainSharedKernels() {
classes()
.that()
.haveSimpleName("package-info")
.and()
.resideInAPackage(ROOT_PACKAGE.concat(".shared.."))
.should()
.beMetaAnnotatedWith(SharedKernel.class)
.because(ROOT_PACKAGE + ".shared package should only contain shared kernels")
.check(classes);
}
}

@Nested
class Wire {

Expand Down

0 comments on commit e2c0741

Please sign in to comment.