camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomohisa Igarashi <tm.igara...@gmail.com>
Subject Re: Camel Spring Unit Testing with Mocks
Date Wed, 12 Oct 2016 06:54:09 GMT
Hi,

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.
https://github.com/apache/camel/blob/master/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInterceptSendToEndpointTest.java#L35

Thanks,
Tomo

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 http://camel.apache.org/testing.html and
> http://camel.apache.org/spring-testing.html
> 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: http://camel.465427.n5.nabble.com/Camel-Spring-Unit-Testing-with-Mocks-tp5788635.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
View raw message