camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quinn Stevenson <>
Subject Re: mock http endpoint and retrieving value form properties file
Date Tue, 17 May 2016 14:41:35 GMT
Deepak -

There are quite a few ways to go about this, but I think the easiest thing for you (given
what you said so far), would be to write a bean the behaves the way you want - set the response
code header to what you (i.e. Exchange.HTTP_RESPONSE_CODE/CamelHttpResponseCode), throw and
exception, whatever.  Then replace the testUrl with a call to your bean.

If you go this route, you won’t actually have to make an HTTP call (you’re basically stubbing
it out).  This makes it much easier to test all kinds of error scenarios.

Hopefully that helps

> On May 16, 2016, at 12:30 PM, Deepak kumar <> wrote:
> Hi Quinn ,
> I got it how to get the value from properties file. But how can i test the
> http endpoint here.and that to based on different http response status? if
> the status will return 404 then i will throw custom exception. how can i
> test these scenarios?
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

View raw message