You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/12/10 15:24:39 UTC

[GitHub] [camel-quarkus] radio042 opened a new issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

radio042 opened a new issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379


   Dear all, 
   
   I have problems testing routes with CamelTestSupport in a Quarkus project when a transacted() definition is part of the route. 
   
   **Describe the bug**
   
   The exchanges do not seem to reach the endpoints, when "transacted()" is part of the route.
   
   Snippets:
   
   - Route: 
   ``` 
   from("direct:in").transacted().to("mock:out");
   ```
   - Test:
    ```
   MockEndpoint mockEndpoint = getMockEndpoint("mock:out");
   mockEndpoint.expectedMessageCount(1);
   template.sendBody("direct:in", "hello");
   assertMockEndpointsSatisfied();
   ```
   
   Here's a Gist of my test setup and the pom.xml: https://gist.github.com/radio042/b71717d5634eaa634c9affc1021eacfb#file-transactedtest-java 
   
   **Expected behavior** 
   
   Messages sent to a route with a transacted() definition using CamelTestSupport in a Quarkus project reach the endpoints and the test is green.
   
   **Actual behavior**
   
   The test fails with `java.lang.AssertionError: mock://out Received message count. Expected: <1> but was: <0>`
   
   **How to Reproduce?**
   
   Run the test from the gist inside a Quarkus project
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] zhfeng commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991417886


   I'm not sure this is a good way but it just works.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 edited a comment on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 edited a comment on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991711263


   Perfect, this solved my problem! Thanks a lot. :) I think it's a good solution, after all in most cases it does not matter which specific CamelContext instance a test uses.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 closed issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 closed issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991198981


   Thanks for the links! The thing is, I am trying to test a camel route that has the `transacted()` definition, not transactions in general. The test would work once "transacted()" is commented out, so I assume that either the test setup is incomplete or the combination "Quarkus + CamelTestSupport + `transacted()`" does not work as I expect.
   
   By the way, is this the right place to raise the issue? I opened it here, because there are a lot of examples of similar tests with Spring online that allegedly work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] zhfeng commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991417792


   I understand and just create a [camel-test-demo]( https://github.com/zhfeng/camel-test-demo) to show how to use ```CamelTestSupport``` in camel-quarkus. Hope it is useful !
   
   Free feel to give some feedback.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 edited a comment on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 edited a comment on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991711263


   Perfect, this solved my problem! Thanks a lot. :) I think it's a good solution, after all in most cases it does not matter which specific CamelContext instance a test uses.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991121789


   I can, but I'm getting the same behavior when annotating the Class with `@QuarkusTest`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] zhfeng commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991088020


   Well, I think we've not support the ```CamelTestSupport``` yet with Camel Quarkus. Is there any reason you can not use ```QuarkusTest``` for running this test ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991711263


   Perfect, this solved my problem! Thanks a lot. :) I think it's a good solution, after all it does not matter which specific CamelContext instance a test uses.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 closed issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 closed issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
ppalaga commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-993255264


   > I understand and just create a [camel-test-demo](https://github.com/zhfeng/camel-test-demo) to show how to use `CamelTestSupport` in camel-quarkus. Hope it is useful !
   
   What a cute hack, @zhfeng! Could you perhaps mention it in https://github.com/apache/camel-quarkus/issues/1981 where some folks asked for `CamelTestSupport`? 
   
   Hm... on the same note, I wonder whether we could somehow set the context automatically. Either by having our own subclass of `CamelTestSupport` (ugly) or something nicer, like implementing a junit5 extension that would do it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 edited a comment on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 edited a comment on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991198981


   Thanks for the links! The thing is, I am trying to test a camel route that has the `transacted()` definition, not transactions in general. The test would work once `transacted()` is commented out, so I assume that either the test setup is incomplete or the combination "Quarkus + CamelTestSupport + `transacted()`" does not work as I expect.
   
   By the way, is this the right place to raise the issue? I opened it here, because there are a lot of examples of similar tests with Spring online that allegedly work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] zhfeng commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991131218


   Please check with our [JtaTest](https://github.com/apache/camel-quarkus/blob/main/integration-tests/jta/src/test/java/org/apache/camel/quarkus/component/jta/it/JtaTest.java), or you can get more details about how to write a test with Quarkus from https://quarkus.io/guides/getting-started-testing


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] zhfeng commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991417792






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] radio042 commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
radio042 commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-991711263


   Perfect, this solved my problem! Thanks a lot. :) I think it's a good solution, after all it does not matter which specific CamelContext instance a test uses.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] zhfeng commented on issue #3379: Testing transacted routes with Quarkus and CamelTestSupport fails

Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #3379:
URL: https://github.com/apache/camel-quarkus/issues/3379#issuecomment-993342540


   @ppalaga yeah, that could be a better way to have a junit5 extension. I will investigate it after the holidays.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org