Can Spring boot test classes reuse the application context to run the test faster?

@ContextConfigurationthe location attribute does not make sense for Spring testing integration with downloads. Is there any other way to reuse the application context in multiple test classes annotated with @SpringBootTest?

+4
source share
2 answers

Yes. In fact, this is the default behavior . The link points to Spring Framework Documents that are used by Spring Boot under the hood.

BTW, , @ContextConfiguration.

+3
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)

, . , .

Spring Boot @SpringBootTest, spring -test @ContextConfiguration, Spring Boot. , ApplicationContext, SpringApplication

+1

Source: https://habr.com/ru/post/1677913/


All Articles