GH-520 - Early reject invalid ApplicationModules bootstraps.

We now immediately reject the ApplicationModules bootstrap in case the initial scanning of the root packages yield no classes at all.
This commit is contained in:
Oliver Drotbohm
2024-03-05 17:46:13 +01:00
parent c45a0fc9b7
commit e41d7ec083
8 changed files with 159 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ import example.declared.first.First;
import example.declared.fourth.Fourth;
import example.declared.second.Second;
import example.declared.third.Third;
import example.empty.EmptyApplication;
import java.util.ArrayList;
import java.util.List;
@@ -234,6 +235,13 @@ class ApplicationModulesIntegrationTest {
.noneMatch(it -> it.contains("Cycle detected: Slice open"));
}
@Test // GH-520
void bootstrapsOnEmptyProject() {
assertThatNoException().isThrownBy(() -> ApplicationModules.of(EmptyApplication.class).verify());
assertThatIllegalArgumentException().isThrownBy(() -> ApplicationModules.of("non.existant"));
}
private static void verifyNamedInterfaces(NamedInterfaces interfaces, String name, Class<?>... types) {
Stream.of(types).forEach(type -> {