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 26, 2024
1 parent 3b99036 commit 19fb09c
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 @@ -252,6 +252,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 @@ -247,6 +247,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 19fb09c

Please sign in to comment.