|
25 | 25 | import org.junit.jupiter.api.BeforeEach;
|
26 | 26 | import org.junit.jupiter.api.Test;
|
27 | 27 |
|
28 |
| -import org.springframework.aot.generate.ClassNameGenerator; |
29 |
| -import org.springframework.aot.generate.DefaultGenerationContext; |
30 |
| -import org.springframework.aot.generate.InMemoryGeneratedFiles; |
31 |
| -import org.springframework.aot.hint.RuntimeHints; |
| 28 | +import org.springframework.aot.generate.GenerationContext; |
32 | 29 | import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
|
33 | 30 | import org.springframework.beans.factory.BeanCreationException;
|
34 | 31 | import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
|
|
37 | 34 | import org.springframework.beans.factory.support.RegisteredBean;
|
38 | 35 | import org.springframework.beans.factory.support.RootBeanDefinition;
|
39 | 36 | import org.springframework.data.domain.ManagedTypes;
|
| 37 | +import org.springframework.test.aot.generate.TestGenerationContext; |
40 | 38 |
|
41 | 39 | /**
|
42 | 40 | * @author Christoph Strobl
|
@@ -86,8 +84,7 @@ void contributesReflectionForManagedTypes() {
|
86 | 84 | BeanRegistrationAotContribution contribution = createPostProcessor("commons")
|
87 | 85 | .processAheadOfTime(RegisteredBean.of(beanFactory, "commons.managed-types"));
|
88 | 86 |
|
89 |
| - DefaultGenerationContext generationContext = new DefaultGenerationContext(new ClassNameGenerator(Object.class), |
90 |
| - new InMemoryGeneratedFiles(), new RuntimeHints()); |
| 87 | + GenerationContext generationContext = new TestGenerationContext(Object.class); |
91 | 88 |
|
92 | 89 | contribution.applyTo(generationContext, null);
|
93 | 90 |
|
@@ -150,8 +147,7 @@ void returnsEmptyContributionWhenBeanCannotBeLoaded() {
|
150 | 147 | BeanRegistrationAotContribution contribution = createPostProcessor("commons")
|
151 | 148 | .processAheadOfTime(RegisteredBean.of(beanFactory, "commons.managed-types"));
|
152 | 149 |
|
153 |
| - DefaultGenerationContext generationContext = new DefaultGenerationContext(new ClassNameGenerator(Object.class), |
154 |
| - new InMemoryGeneratedFiles(), new RuntimeHints()); |
| 150 | + GenerationContext generationContext = new TestGenerationContext(Object.class); |
155 | 151 |
|
156 | 152 | contribution.applyTo(generationContext, null);
|
157 | 153 |
|
|
0 commit comments