assertNotBeAccessedByAnyPackage

fun List<ClassDeclaration>.assertNotBeAccessedByAnyPackage(vararg packagePatterns: String, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that the selected classes are not accessed by any class residing in packages matching the specified patterns.

Example:

domainModels.assertNotBeAccessedByAnyPackage("..web..", "..adapter..")

Parameters

packagePatterns

Package wildcard patterns representing forbidden accessing classes.

allClasses

The complete collection of class declarations used for dependency resolution. Defaults to all classes in the loaded project graph.

Throws

if any forbidden class accesses any of the target classes.


fun KontureScope.assertNotBeAccessedByAnyPackage(vararg packagePatterns: String, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that the selected classes in the scope are not accessed by any class residing in packages matching the specified patterns.

Parameters

packagePatterns

Package wildcard patterns representing forbidden accessing classes.

allClasses

The complete collection of class declarations used for dependency resolution. Defaults to all classes in the loaded project graph.

Throws

if any forbidden class accesses any of the target classes.