Hello,

We are currently (happily) using Camel 3.4.4.

When trying to upgrade to any version beyond 3.5.0 (also 3.11.1), our 
integration tests won't run anymore. At first it complained about the 
@LocalServerPort annotation not working, but it turned out the spring boot 
(including the webserver) just wasn't loading properly.

I have reduced it to a very simple testcase:

@SpringBootTest(classes = StudentMain.class, webEnvironment = 
SpringBootTest.WebEnvironment.DEFINED_PORT)
@ActiveProfiles("integrationtest")
@RunWith(CamelSpringBootRunner.class)
public class ConfigsRouteBuilderTest  {

    private int port = 8080;

    @Test
    public void testConfigsRoute() throws Exception {
        HttpEntity<String> httpEntity = new HttpEntity<String>(new 
HttpHeaders());
        String uri = 
String.format(http://localhost:%d/integrationtest/hello<http://localhost:%25d/integrationtest/hello>,
 port);
        ResponseEntity<String> response = new RestTemplate().exchange(uri, 
HttpMethod.GET, httpEntity, String.class);

        assertEquals("<text>hello world!</text>", response.getBody());
    }

}


When I try to run this test with 3.4.4, it runs fine. When I try to run it with 
Apache camel 3.5.0 or 3.11.1, it is simply not starting right. The 
CampelSpringBootRunner does not seem to kick into action. There is no spring 
boot logo, no tomcat starting and the test obviously fails with "I/O error on 
GET request for http://localhost:8080/integrationtest/hello: Connection refused"

Does anyone know what I miss to get things going? Do I need to use different 
annotations since 3.5.0?

I have also tested with jUnit5 instead of 4, this didn't make a difference.

I am new to this group and not sure if this group allows attachments, but I 
have added my pom.xml for reference and could provide a ZIP of the whole 
testcase as well.

Regards,
Evert-Jan



Evert-Jan de Bruin | Software Architect | CACI bv | De Ruijterkade 7, 1013 AA 
Amsterdam | +31 (088) 654 35 00 | 
[email protected]<mailto:[email protected]> | 
www.caci.nl<http://www.caci.nl/>

Attachment: pom.xml
Description: pom.xml

Reply via email to