The creation of the spring context to execute your integration test in fundamental, in each case to turn it on you have to follow some steps

First add the spring-test dependency:


<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>5.1.6.RELEASE</version>
    <scope>test</scope>
</dependency>

Second Add the @SpringRunner in your class

    @RunWith(SpringRunner.class)

And finally add the context configuration in your class

    @ContextConfiguration(classes = ApplicationConfiguration.class)

Note that in this case you can either define the ApplicationConfiguration used in your production context or your can create another one specific for your tests.