package com.neoteric.starter.test.restassured;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.jayway.restassured.RestAssured;
import com.jayway.restassured.config.ObjectMapperConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.support.AbstractTestExecutionListener;

import static com.neoteric.starter.test.StarterTestConstants.JACKSON_OBJECT_MAPPER_BEAN;
import static com.neoteric.starter.test.StarterTestConstants.LOCAL_SERVER_PORT;

public class RestAssuredListener extends AbstractTestExecutionListener {

    @Override
    public void beforeTestClass(TestContext testContext) throws Exception {
        if (testContext.getTestClass().getAnnotation(ContainerIntegrationTest.class) == null) {
            return;
        }
        ApplicationContext applicationContext = testContext.getApplicationContext();
        String property = applicationContext.getEnvironment().getProperty(LOCAL_SERVER_PORT);
        RestAssured.port = Integer.parseInt(property);

        ObjectMapper objectMapper = applicationContext.getBean(JACKSON_OBJECT_MAPPER_BEAN, ObjectMapper.class);

        RestAssured.config = RestAssured.config().objectMapperConfig(
                new ObjectMapperConfig().jackson2ObjectMapperFactory((cls, charset) -> objectMapper));
    }

    @Override
    public int getOrder() {
        return 800;
    }
}
@@ -240,32 +240,92 @@
 icationContext;%0A
+import org.springframework.core.annotation.AnnotationUtils;%0A
 import org.sprin
@@ -786,16 +786,47 @@
      if 
+(AnnotationUtils.findAnnotation
 (testCon
@@ -848,23 +848,10 @@
 ss()
-.getAnnotation(
+, 
 Cont

Make RestAssuredListener find ContainerIntegrationtest annotation, as it does not need to be explicitly set on Test class