In unit test, what are the differences between @Runwith(SpringRunner.class) & @SpringBootTest?
Can you explain to me the use cases of
From spring.io :
@RunWith(SpringRunner.class)tells JUnit to run using Spring’s testing support.SpringRunneris the new name forSpringJUnit4ClassRunner, it’s just a bit easier on the eye.
@SpringBootTestis saying “bootstrap with Spring Boot’s support” (e.g. loadapplication.propertiesand give me all the Spring Boot goodness)
So if you don't need everything that Spring Boot loads for your integration test, you may not need @SpringBootTest