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 <dksahoo...@gmail.com> 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: 
> http://camel.465427.n5.nabble.com/mock-http-endpoint-and-retrieving-value-form-properties-file-tp5782604p5782674.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to