When upgrading from 2.2.5 to 2.3.2 the build started failing. We have a simple application with a database. The connection pool (HikariCP) suddenly got initialized after every test class depleting available connections to the Postgres DB running with Docker.

Some digging around context caching <Logger name="org.springframework.test.context.cache" level="debug"/> showed a cache miss after every test class. The only difference between the cache keys was:

MockitoContextCustomizer@7497cc36
MockitoContextCustomizer@a2982d0d

I do not see the issue when using 2.3.1.

The parent integration test class:

@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = Launcher.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
@TestPropertySource(properties = "REGION=eu-central-1")
public abstract class BaseIntegrationTest {

We only use @MockBean in the parent class - to avoid multiple test context so before upgrading only one context started per build.

Comment From: snicoll

Thanks for the report. That's a duplicate of #22566