Hi Claus, How strict is the @EndpointInject uri parameter? I’ve never included anything past the ? and it has managed to inject the mock endpoints for me? eg
<to uri=“jms:queue:my_queue?transacted=true”/> @EndpointInject(uri=“mock:jms:queue:my_queue”) MockEndpoint mockJms; On 20 Dec 2014, at 2:52 am, Claus Ibsen <[email protected]> wrote: > 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 <[email protected]> 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: [email protected] > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > hawtio: http://hawt.io/ > fabric8: http://fabric8.io/
