Skip to content

Commit fd3137c

Browse files
christophstroblmp911de
authored andcommitted
Follow AOT repository contributor changes in data-commons.
Closes #3972
1 parent d5d9332 commit fd3137c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/aot/AotContributionIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ private static TestGenerationContext generate(Class<?>... configurationClasses)
7878

7979
TestGenerationContext generationContext = new TestGenerationContext();
8080
generator.processAheadOfTime(context, generationContext);
81+
generationContext.writeGeneratedContent();
8182
return generationContext;
8283
}
8384

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/aot/AotFragmentTestConfigurationSupport.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
102102
new JpaRepositoryContributor(repositoryContext).contribute(generationContext);
103103

104104
AbstractBeanDefinition aotGeneratedRepository = BeanDefinitionBuilder
105-
.genericBeanDefinition(repositoryInterface.getName() + "Impl__Aot")
105+
.genericBeanDefinition(repositoryInterface.getName() + "Impl__AotRepository")
106106
.addConstructorArgValue(new RuntimeBeanReference(EntityManager.class))
107107
.addConstructorArgValue(
108108
getCreationContext(repositoryContext, beanFactory.getBean(Environment.class), beanFactory))
109109
.getBeanDefinition();
110110

111+
generationContext.writeGeneratedContent();
112+
111113
TestCompiler.forSystem().withCompilerOptions("-parameters").with(generationContext).compile(compiled -> {
112114
beanFactory.setBeanClassLoader(compiled.getClassLoader());
113115
((BeanDefinitionRegistry) beanFactory).registerBeanDefinition("fragment", aotGeneratedRepository);

0 commit comments

Comments
 (0)