Hey <#C05QG9FD6KS|konsist>, is there any way to te...
# konsist
m
Hey #konsist, is there any way to test that a layer DOES NOT depend on another layer? Or alternatively, that no class in package x imports one from package y?
p
You mean as addition to the
dependsOn
in the
assertArchitecture?
m
Yea maybe, dependsNotOn - but I'm asking for any solution with the current version
this would be useful for modulith architecture testing
p
I also asked for this in the past but this is not possible with
assertArchitecture
and the defined layers. My workarount is:
Copy code
@Test
    fun `package A should not depend on package B`() {
        projectScope
            .files
            .withPackage("..packageA..")
            .assertFalse {
                it.hasImportWithName(
                   "..packageB..
                )
            }
    }
👍 3
m
Ah, files, I always tried classes 🙂 thanks!
p
🙂