A cache key identifies the configuration of a Spring test application context. The Spring TestContext Framework uses it to decide whether an existing ApplicationContext can be reused or a new one must be started. section 3.5.1
The key broadly reflects:
- Properties supplied to the test application. section 3.5.1
- Active profiles. section 3.5.1
- Configuration classes or beans loaded into the application. section 3.5.1
Identical test configurations
Two nested tests using the same @SpringBootTest configuration can share one running context: the first test produces a cache miss, while the second produces a cache hit.



