I am writing my tests using rest-assured and Spring Boot. Unfortunatly the service is not starting in the tests. This is my code:
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ServiceApplication.class)
@WebAppConfiguration
@IntegrationTest("server.port:8083")
@Slf4j
public class ServicePingIT {
@Value("${local.server.port}")
int port;
private String Uri = "/service/ping";
private String validation = "Service is up and running...";
@Before
public void setup() {
RestAssured.port = port;
RestAssured.baseURI="http://localhost";
}
@Test
public void validatePingBody() {
log.info("");
validateREsponse(Uri, validation);
}
What is wrong with my test setup that the service is not starting? In the logs I do see that Tomcat starts at the port but fails with this error:
ERROR 7432 --- [cat-startStop-1] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/service]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)