You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a mistake in my layeredArchitecture definition. There is no layer called control:
@ArchTest
public static final ArchRule layerRule = layeredArchitecture()
.layer("boundary").definedBy("..boundary..")
.layer("service").definedBy("..control.service..")
.layer("repository").definedBy("..control.repository..")
.layer("entity").definedBy("..entity..")
.whereLayer("boundary").mayNotBeAccessedByAnyLayer()
.whereLayer("repository").mayOnlyBeAccessedByLayers("boundary", "control")
.whereLayer("service").mayOnlyBeAccessedByLayers("boundary")
.whereLayer("entity").mayOnlyBeAccessedByLayers("boundary", "control");
When I execute the test I get a NPE:
java.lang.NullPointerException
at com.tngtech.archunit.library.Architectures$LayeredArchitecture$LayerDefinition.access$500(Architectures.java:229)
at com.tngtech.archunit.library.Architectures$LayeredArchitecture.packagesOf(Architectures.java:218)
at com.tngtech.archunit.library.Architectures$LayeredArchitecture.evaluate(Architectures.java:151)
at com.tngtech.archunit.lang.ArchRule$Assertions.check(ArchRule.java:79)
at com.tngtech.archunit.library.Architectures$LayeredArchitecture.check(Architectures.java:174)
at com.tngtech.archunit.junit.ArchRuleExecution.evaluateOn(ArchRuleExecution.java:57)
at com.tngtech.archunit.junit.ArchUnitRunner.runChild(ArchUnitRunner.java:134)
at com.tngtech.archunit.junit.ArchUnitRunner.runChild(ArchUnitRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at com.tngtech.archunit.junit.ArchUnitRunner$1.evaluate(ArchUnitRunner.java:73)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
It would be great to print a meaningful error message instead of the NPE.
The text was updated successfully, but these errors were encountered:
I made a mistake in my layeredArchitecture definition. There is no layer called control:
When I execute the test I get a NPE:
It would be great to print a meaningful error message instead of the NPE.
The text was updated successfully, but these errors were encountered: