build: remove unused archunit dependency

This commit is contained in:
lingniu
2026-07-01 13:15:05 +08:00
parent 28bde233a1
commit 57ab57c42b
2 changed files with 21 additions and 8 deletions

View File

@@ -243,6 +243,18 @@ class MavenModuleProfileTest {
.isFalse();
}
@Test
void buildSurfaceDoesNotManageArchUnitWhenThereAreNoArchitectureTests() throws Exception {
Document pom = rootPom();
assertThat(hasProjectProperty(pom, "archunit.version"))
.isFalse();
assertThat(hasDependency(pom, "com.tngtech.archunit", "archunit-junit5"))
.isFalse();
assertThat(javaSourcesContain("import com.tngtech." + "archunit"))
.isFalse();
}
@Test
void productionDocsDoNotAdvertiseMemorySessionStore() throws Exception {
String runbook = Files.readString(repositoryRoot()
@@ -489,11 +501,19 @@ class MavenModuleProfileTest {
}
private static boolean productionJavaContains(String token) throws Exception {
return javaSourcesContain(token, false);
}
private static boolean javaSourcesContain(String token) throws Exception {
return javaSourcesContain(token, true);
}
private static boolean javaSourcesContain(String token, boolean includeTests) throws Exception {
try (Stream<Path> files = Files.walk(repositoryRoot().resolve("modules"))) {
return files
.filter(Files::isRegularFile)
.filter(path -> path.toString().endsWith(".java"))
.filter(path -> !path.toString().contains("/src/test/"))
.filter(path -> includeTests || !path.toString().contains("/src/test/"))
.anyMatch(path -> {
try {
return Files.readString(path).contains(token);