Understanding when and how many Spring ApplicationContexts are created in your test suite allows you to optimize build times by leveraging Spring TestContext's context caching feature, which reuses already started contexts.
Click to learn about Spring TestContext context caching principles and optimization tips
Start typing to search for test classes. Results will appear after entering 3 or more characters.
server.port=8081 spring.datasource.url=jdbc:h2:mem:badtest2;DB_CLOSE_DELAY=-1 spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true management.endpoints.web.exposure.include=health,info org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true
spring.datasource.url=jdbc:h2:mem:badtest3;DB_CLOSE_DELAY=-1 spring.jpa.hibernate.ddl-auto=create-drop server.servlet.context-path=/api/v1 spring.jackson.property-naming-strategy=SNAKE_CASE org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true server.port=0
Reduce context variations by standardizing test configurations, profiles, and component scanning paths across similar test classes.
Replace @SpringBootTest with slice tests like @WebMvcTest, @DataJpaTest when testing specific layers.
Limit component scanning scope using @ComponentScan(basePackages) or exclude unnecessary configurations.
Create common @TestConfiguration classes that can be reused across multiple test classes.
Code analysis identified potential issues that may impact Spring context caching and test performance.
This section shows all unique Spring context configurations detected during test execution, grouped by their MergedContextConfiguration.
Click on any test class below to expand and see detailed information about individual test methods, including execution times and failure details.