implements PLN-0129
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 62.10% (17811/28682)
* Branch Coverage: 52.81% (6878/13025)
* Lines of Code: 28682
* Cyclomatic Complexity: 11494
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 654
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
Intrepid/Prometeu/Studio/pipeline/pr-master This commit looks good
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 62.10% (17811/28682)
* Branch Coverage: 52.81% (6878/13025)
* Lines of Code: 28682
* Cyclomatic Complexity: 11494
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 654
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
Intrepid/Prometeu/Studio/pipeline/pr-master This commit looks good
Add ArchUnit guards for Java multi-frontend boundaries in a test-only module. Identify PBS by frontend-module origin, allow only the registry as composition root, and lock the wording in specs 19, 20, and 22. Housekeep DSC-0064 with LSN-0066.
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
package p.studio.architecture;
|
||||
|
||||
import com.tngtech.archunit.core.importer.ClassFileImporter;
|
||||
import com.tngtech.archunit.core.importer.ImportOption;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
class PbsModuleClasspathTest {
|
||||
|
||||
@Test
|
||||
void importerMustSeePbsAndRegistryModuleOrigins() {
|
||||
final var classes = new ClassFileImporter()
|
||||
.withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS)
|
||||
.importPackages("p.studio");
|
||||
|
||||
final var pbsSample = classes.stream()
|
||||
.filter(PbsModuleOrigins::isPbsModule)
|
||||
.findFirst();
|
||||
final var registrySample = classes.stream()
|
||||
.filter(PbsModuleOrigins::isRegistryModule)
|
||||
.findFirst();
|
||||
|
||||
if (pbsSample.isEmpty() || registrySample.isEmpty()) {
|
||||
final var uris = classes.stream()
|
||||
.limit(20)
|
||||
.map(javaClass -> javaClass.getName() + " -> " + PbsModuleOrigins.sourceUri(javaClass))
|
||||
.toList();
|
||||
fail("PBS/registry module origins were not visible to ArchUnit. sample URIs: " + uris);
|
||||
}
|
||||
|
||||
assertTrue(pbsSample.isPresent());
|
||||
assertTrue(registrySample.isPresent());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user