GH-406 - Ignore Spring AOT generated types in architecture model.

We now explicitly exclude classes generated by Spring AOT in the architectural model. For technical reasons, they might introduce dependencies to application components considered module internals otherwise. Also, proxies generated do not need to be considered either.
This commit is contained in:
Oliver Drotbohm
2023-12-06 14:17:43 +01:00
parent da43c72828
commit e7b531e061
5 changed files with 65 additions and 1 deletions

View File

@@ -30,6 +30,8 @@ import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import com.acme.myproject.Application;
import com.acme.myproject.aot.Some$$SpringCGLIB$$Proxy;
import com.acme.myproject.aot.Spring__Aot;
import com.acme.myproject.complex.internal.FirstTypeBasedPort;
import com.acme.myproject.complex.internal.SecondTypeBasePort;
import com.acme.myproject.moduleA.ServiceComponentA;
@@ -185,6 +187,15 @@ class ApplicationModulesIntegrationTest {
assertThat(third.getDeclaredDependencies(modules).isAllowedDependency(Fourth.class)).isTrue();
}
@Test // GH-406
void excludesSpringAOTGeneratedTypes() {
assertThat(modules.getModuleByName("aot")).hasValueSatisfying(it -> {
assertThat(it.contains(Spring__Aot.class)).isFalse();
assertThat(it.contains(Some$$SpringCGLIB$$Proxy.class)).isFalse();
});
}
private static void verifyNamedInterfaces(NamedInterfaces interfaces, String name, Class<?>... types) {
Stream.of(types).forEach(type -> {