At present, we use @springboottest and @ContextConfiguration. However, every time a unit test is started, it will have to load resources (various configuration files, initialize spring containers, and establish various connections), which is very time-consuming. Question: 1: Do you have a solution to support unit testing that can reuse the last resource? Or give us some advice 2: Do you know that other enterprises have solved such problems? To achieve this goal, our idea is: Start the ioc first, and then request the service to be started when executing the unit test. In this way, the problem of multiple loading of resources can be solved. However, this practice is actually equivalent to the interface request server, so I don't know whether this design idea is feasible?
Comment From: snicoll
@wjx1990323 context across tests are cached and you can find more details about that in the reference guide of the Spring Framework.
If you have more questions, please follow-up on StackOverflow or come chat with the community on Gitter, as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.