Description
Overview
As alluded to in #32925, it's possible to run AOT tests for bean override support in the Spring TestContext Framework (TCF) manually via the endToEndTestsForEntireSpringTestModule()
and endToEndTestsForSelectedTestClasses()
methods in AotIntegrationTests
; however, that must be performed manually.
In order to ensure that tests using the new bean override support (@TestBean
, @MockitoBean
, and @MockitoSpyBean
) run correctly in AOT mode, we need to introduce dedicated tests that are run with every build.
As a bare minimum, AotIntegrationTests.endToEndTests()
must be modified to include test classes that utilize the basic features of @TestBean
, @MockitoBean
, and @MockitoSpyBean
.
The test classes included could be existing ones from the org.springframework.test.context.bean.override.convention
and org.springframework.test.context.bean.override.mockito
packages, or we could create new, simplified test classes in org.springframework.test.context.aot.samples.bean.override
.