Skip to content

Commit a8f5848

Browse files
committed
Add missing runtime hint assertions for Bean Overrides
1 parent 97f23dc commit a8f5848

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spring-test/src/test/java/org/springframework/test/context/aot/TestContextAotGeneratorIntegrationTests.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,11 @@ private static void assertRuntimeHints(RuntimeHints runtimeHints) {
212212
Stream.of(
213213
// @TestExecutionListeners
214214
org.springframework.test.context.aot.samples.basic.BasicSpringJupiterTests.DummyTestExecutionListener.class,
215+
// Auto-registered
215216
org.springframework.test.context.event.ApplicationEventsTestExecutionListener.class,
216217
org.springframework.test.context.event.EventPublishingTestExecutionListener.class,
217218
org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener.class,
219+
org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener.class,
218220
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.class,
219221
org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener.class,
220222
org.springframework.test.context.support.DirtiesContextTestExecutionListener.class,
@@ -224,6 +226,7 @@ private static void assertRuntimeHints(RuntimeHints runtimeHints) {
224226

225227
// ContextCustomizerFactory
226228
Stream.of(
229+
"org.springframework.test.context.bean.override.BeanOverrideContextCustomizerFactory",
227230
"org.springframework.test.context.support.DynamicPropertiesContextCustomizerFactory",
228231
"org.springframework.test.context.web.socket.MockServerContainerContextCustomizerFactory",
229232
"org.springframework.test.context.aot.samples.basic.ImportsContextCustomizerFactory"
@@ -271,8 +274,12 @@ private static void assertRuntimeHints(RuntimeHints runtimeHints) {
271274
.accepts(runtimeHints);
272275

273276
// @BeanOverride(value = ...)
274-
assertReflectionRegistered(runtimeHints, "org.springframework.test.context.bean.override.mockito.MockitoBeanOverrideProcessor",
275-
INVOKE_DECLARED_CONSTRUCTORS);
277+
Stream.of(
278+
// @MockitoBean
279+
"org.springframework.test.context.bean.override.mockito.MockitoBeanOverrideProcessor",
280+
// @EasyMockBean
281+
"org.springframework.test.context.bean.override.easymock.EasyMockBeanOverrideProcessor"
282+
).forEach(type -> assertReflectionRegistered(runtimeHints, type, INVOKE_DECLARED_CONSTRUCTORS));
276283

277284
// GenericApplicationContext.preDetermineBeanTypes() should have registered proxy
278285
// hints for the EasyMock interface-based mocks.

0 commit comments

Comments
 (0)