Description
There is a good practice to add an integration test that Spring context is loaded correctly (see https://www.jvt.me/posts/2021/06/25/spring-context-test/ for more details).
If this test fails, all other tests fail automatically an the problem is not in the method under test, but in context autowiring.
@Test
void contextLoads() {
// This test fails if our Spring configuration is not loaded correctly
}
We should also try to obtain the cause of Spring context incorrect loading from our application instantiator (however, it may be difficult) and to show it to the user.
@Test
void contextLoads() {
// This test fails if our Spring configuration is not loaded correctly
// The reason is <Exception type, message and cause>
}
Description
There is a good practice to add an integration test that Spring context is loaded correctly (see https://www.jvt.me/posts/2021/06/25/spring-context-test/ for more details).
If this test fails, all other tests fail automatically an the problem is not in the method under test, but in context autowiring.
We should also try to obtain the cause of Spring context incorrect loading from our application instantiator (however, it may be difficult) and to show it to the user.