Break dependency between TestCompiler and AOT
This commit improves `TestCompiler` with a `with` function that allows to customize a test compiler instance. Rather than `TestCompiler` knowing about `TestGenerationContext`, the latter implements the function so that it can be passed as is. See gh-29175
This commit is contained in:
@@ -151,7 +151,7 @@ class ScopedProxyBeanRegistrationAotProcessorTests {
|
||||
.build());
|
||||
});
|
||||
this.generationContext.writeGeneratedContent();
|
||||
TestCompiler.forSystem().withFiles(this.generationContext.getGeneratedFiles()).compile(compiled -> {
|
||||
TestCompiler.forSystem().with(this.generationContext).compile(compiled -> {
|
||||
DefaultListableBeanFactory freshBeanFactory = new DefaultListableBeanFactory();
|
||||
freshBeanFactory.setBeanClassLoader(compiled.getClassLoader());
|
||||
compiled.getInstance(Consumer.class).accept(freshBeanFactory);
|
||||
|
||||
Reference in New Issue
Block a user