camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Tracy <>
Subject Re: Camel Spring Unit Testing with Mocks
Date Wed, 12 Oct 2016 13:15:14 GMT
That looks like what I am looking for.  Two questions.  First, is this the recommended way
to do this type of test?Second, can the createRouteBuilder be the one in the actual prod route
or do I have to copy my prod route into it?

Sent from Yahoo Mail on Android 
  On Wed, Oct 12, 2016 at 12:54 AM, Tomohisa Igarashi<> wrote:

Is this what you're looking for as an example? interceptSendToEndpoint()&skipSendToOriginalEndpoint()
via AdviceWithRouteBuilder intercepts sending to the actual endpoint defined in spring XML
and forwarding it to the mock endpoint for testing purpose.


On 10/12/2016 05:54 AM, catequil wrote:
> Background
> I'm a newbie to Apache Camel. (3 months)
> I have read the testing section to Camel in Action MEAP version.
> I have read and
> I have searched this forum, google and stackoverflow for answers.
> I've tried using the adviceWith, but that is confusing too.
> Current versions are Camel 2.16.2 and Spring 4.0.6 and Junit 4.12
> Dependencies loaded: {camel-core, camel-spring, camel-cxf, camel-jackson,
> camel-test, camel-test-spring40, camel-kafka, spring-test}
> Criteria
> DRY (No identical code in testing)
> Cannot modify production code.
> Must use Mocks as integration tests would take too long to run.
> Must use CamelSpringTestSupport (The only configuration I can get to work in
> my environment that supports spring and camel)
> Question
> The part I am struggling with the most, for a week now, is the Mocks.  They
> do not make sense to me on how they work in relation to the production
> version of the route.
> Can some one please help me to create a unit test that works having all this
> criteria and help me understand the Mocking for Endpoints?
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message