You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Karen Lease (Jira)" <ji...@apache.org> on 2021/09/09 11:01:00 UTC

[jira] [Commented] (CAMEL-16925) Integration tests on REST services broken since 3.5.0 with camel-spring-boot

    [ https://issues.apache.org/jira/browse/CAMEL-16925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17412513#comment-17412513 ] 

Karen Lease commented on CAMEL-16925:
-------------------------------------

Using camel 3.11.1 and junit5, the application-integrationtest.yml needs to be changed because the context-path is now specified on camel.servlet.mapping and not camel.component.servlet.mapping. The attached [^rest_service_test_junit5_ok.7z] contains the changed files which result in a working test.
However I didn't get it to work with junit4; the Camel routes are not started which is why the Tomcat server is not launched.

> Integration tests on REST services broken since 3.5.0 with camel-spring-boot
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-16925
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16925
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-boot, tests
>    Affects Versions: 3.5.0, 3.11.0
>            Reporter: Evert-Jan de Bruin
>            Priority: Minor
>         Attachments: rest_service_test_bug.zip, rest_service_test_junit5_ok.7z
>
>
> In Camel 3.4.x it was possible to write an integration test for REST services, in which the rest Camel route would actually run on a tomcat servlet and could be tested via HTTP. 
> Since Camel 3.5.0 this functionality seems broken. The tomcat server no longer boots during tests, so the REST service no longer works either.
> I have attached a sample case. 
> To reproduce:
> - Run 'mvn clean test' in the root directory and see that the unit test succeeds. 
> - Alter the version of camel in the pom.xml file to 3.5.0 or higher. 
> - Run 'mvn clean test' again.
> - Test fails because REST service is not running and cannot be contacted by the RestTemplate.
> The example uses JUnit 4 since we were not able to get this testcase running with JUnit 5 in Camel 3.4.4. either.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)