camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: @EndpointInject not working
Date Fri, 19 Dec 2014 15:52:15 GMT
Hi

There is an annotation you need to use

@MockEndpoints

And in your @EndpointInject you must use 100% the same url as in the
route, but with "mock:" as prefix. Also including the ? parameters.

On Fri, Dec 19, 2014 at 4:04 PM, winniwinter <winniwinter@me.com> wrote:
> Hi,
>
>
>
> I'm using Camel 2.14.x and do Unit tests with
> AbstractJUnit4SpringContextTests.
> My routes are written in java dsl. The camelcontext gets instantiated by
> spring.
>
> I want to mock my endpoint and don't know/understand the best practise
>
> My route looks like that:
>
>         from("direct:application").id("firstbird-incomming-applications")
>
> .to("log:eu.firstbird.firstbirdapi.application.consumer.firstbird-incomming-applications-start?level=INFO")
>                 .log(LoggingLevel.INFO, logger, "Sending job application to
> queue")
>                 .setExchangePattern(ExchangePattern.InOnly)
>                 .dynamicRouter().method(customerRouter,
> "routeApplicationByCustomerType")
>                 .process(new FirstbirdApplicationResponseProcessor())
>
> .to("log:eu.firstbird.firstbirdapi.application.consumer.firstbird-incomming-applications-end?level=INFO");
>
>
> Now I would like to mock the last log statement. To do that I thought I just
> do it like that:
>
> @EndpointInject(uri =
> "mock:log:eu.firstbird.firstbirdapi.application.consumer.firstbird-incomming-applications-end")
>     private MockEndpoint mock;
>
>
> But sadly that doesn't work. I don't have any exchanges...
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/EndpointInject-not-working-tp5760927.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message