SpringBoot - @SpringBootTest annotation
@SpringBootTest
annotation will search entire beans which @SpringBootApplication defines in ApplicationContext so it requires to have all dependent component up and running such as database etc. So this annotation will be the best for integration tests.
@SpringBootTest
will use the mock servlet for testing Web components. If we want to launch a real HTTP serer such as Tomcat, we have to provide the following parameter.
1
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)