I'm looking for some recommendations or best practices to implement the unit test of spring boot application.
I have multiple classes of unit test and in each of those classes, I need to add the configuration like :
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringBootApplication.class)
public class ServiceRequestControllerTest{
...
}
So, when I run the goal maven test (mvn clean test), the spring configuration is loaded for multiple times. For example, I have five unit test classes, so, it loads the configuration five times which is slowing down the building of the project.
The question: is there any way to load this configuration just for one time for all the unit test classes?