|
|
|
@ -63,7 +63,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
@@ -63,7 +63,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
|
|
|
|
|
void shouldProcessRegistrarOnConfiguration() { |
|
|
|
|
GenericApplicationContext applicationContext = createApplicationContext( |
|
|
|
|
ConfigurationWithHints.class); |
|
|
|
|
this.generator.generateApplicationContext(applicationContext, |
|
|
|
|
this.generator.processAheadOfTime(applicationContext, |
|
|
|
|
this.generationContext); |
|
|
|
|
assertThatSampleRegistrarContributed(); |
|
|
|
|
} |
|
|
|
@ -72,7 +72,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
@@ -72,7 +72,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
|
|
|
|
|
void shouldProcessRegistrarOnBeanMethod() { |
|
|
|
|
GenericApplicationContext applicationContext = createApplicationContext( |
|
|
|
|
ConfigurationWithBeanDeclaringHints.class); |
|
|
|
|
this.generator.generateApplicationContext(applicationContext, |
|
|
|
|
this.generator.processAheadOfTime(applicationContext, |
|
|
|
|
this.generationContext); |
|
|
|
|
assertThatSampleRegistrarContributed(); |
|
|
|
|
} |
|
|
|
@ -82,7 +82,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
@@ -82,7 +82,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
|
|
|
|
|
GenericApplicationContext applicationContext = createApplicationContext(); |
|
|
|
|
applicationContext.setClassLoader( |
|
|
|
|
new TestSpringFactoriesClassLoader("test-runtime-hints-aot.factories")); |
|
|
|
|
this.generator.generateApplicationContext(applicationContext, |
|
|
|
|
this.generator.processAheadOfTime(applicationContext, |
|
|
|
|
this.generationContext); |
|
|
|
|
assertThatSampleRegistrarContributed(); |
|
|
|
|
} |
|
|
|
@ -97,7 +97,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
@@ -97,7 +97,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
|
|
|
|
|
applicationContext.setClassLoader( |
|
|
|
|
new TestSpringFactoriesClassLoader("test-duplicated-runtime-hints-aot.factories")); |
|
|
|
|
IncrementalRuntimeHintsRegistrar.counter.set(0); |
|
|
|
|
this.generator.generateApplicationContext(applicationContext, |
|
|
|
|
this.generator.processAheadOfTime(applicationContext, |
|
|
|
|
this.generationContext); |
|
|
|
|
RuntimeHints runtimeHints = this.generationContext.getRuntimeHints(); |
|
|
|
|
assertThat(runtimeHints.resources().resourceBundles().map(ResourceBundleHint::getBaseName)) |
|
|
|
@ -109,7 +109,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
@@ -109,7 +109,7 @@ class RuntimeHintsBeanFactoryInitializationAotProcessorTests {
|
|
|
|
|
void shouldRejectRuntimeHintsRegistrarWithoutDefaultConstructor() { |
|
|
|
|
GenericApplicationContext applicationContext = createApplicationContext( |
|
|
|
|
ConfigurationWithIllegalRegistrar.class); |
|
|
|
|
assertThatThrownBy(() -> this.generator.generateApplicationContext( |
|
|
|
|
assertThatThrownBy(() -> this.generator.processAheadOfTime( |
|
|
|
|
applicationContext, this.generationContext)) |
|
|
|
|
.isInstanceOf(BeanInstantiationException.class); |
|
|
|
|
} |
|
|
|
|