camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcb55 <>
Subject Re: How to mock endpoints taking lots of different query parameters values?
Date Thu, 20 Sep 2012 08:00:11 GMT
Hi Claus,

I don't think your idea will work for me. In my example above I did
statically list all the query parameter combinations, but in my real code
they are generated dynamically. So really my route looks more like:


The 'ClassThatGeneratesDynamicUriHeader' simply builds the full URI for the
recipient list to invoke on - the real code will have a URI starting with
'', whereas my unit tests will have a URI
starting with 'mock:MockedService' - and both will have the various query
parameters appended to the URI (i.e.

So that is why I want to simply write...:

  Processor emulator = new EmulatorThatActsLikeTheComplexHttpService(); 
  MockEndpoint mock = getMockEndpoint("mock:Service***"); 
  mock.whenAnyExchangeReceived(emulator); have my emulator called for all calls to the mock service endpoint
with the numerous query parameter combinations (i.e. I specifically don't
want to have to pre-define all those combinations and register a
'whenAnyExchangeReceived()' call for each of them - I just want to wildcard
that registration!).

Maybe people just don't work with dynamically generated Http URI's that
much! I know I can get this working with a simple 'adviceWith()' construct
(since that does allow endpoints to be 'wildcarded'), I just thought the
above 3 lines of code would be more intuitive and easy for people).

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message