oscerd commented on PR #13507:
URL: https://github.com/apache/camel/pull/13507#issuecomment-1999783091

   > Is there a way to write a test to cover this "onFailure" part ?
   > 
   > for now I'm manully testing with route like:
   > 
   > ```
   >   public static final String AZURE_SERVICE_BUS_COMPONENT = 
"azure-servicebus";
   >   @Override
   >   public void configure() {
   >     String subscription = "test-scr";
   >     String inputTopic = "test";
   >     fromF("%s:%s?subscriptionName=%s&enableDeadLettering=true", 
AZURE_SERVICE_BUS_COMPONENT, inputTopic, subscription)
   >         .routeId("routeTestId")
   >         .throwException(new Exception("test failure"))
   >         .log("${body}");
   > 
   >   }
   > ```
   
   In this component we are only using integration tests, so you could have a 
look at ServiceBusConsumerTest and write a similar tests with this option 
enabled, but you'll need a real Azure Servicebus queue/topic.


-- 
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-unsubscr...@camel.apache.org

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

Reply via email to