camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From winniwinter <winniwin...@me.com>
Subject Re: @EndpointInject not working
Date Fri, 19 Dec 2014 18:14:24 GMT
Hi Claus,

thanks for your reply. 

I updated my test according to your description but it doesn't work

@MockEndpoints
public class FirstBirdApplicationsTest extends
AbstractJUnit4SpringContextTests {

....
    @EndpointInject(uri =
"mock:log:eu.firstbird.firstbirdapi.application.consumer.firstbird-incomming-applications-end?level=INFO")
    private MockEndpoint mock;

...
}

That does not work. I payed a little bit around and came across the
AdviceWith statement. That actually works..but I quite don't understand it
:O   :

public class FirstBirdApplicationsTest extends
AbstractJUnit4SpringContextTests {
....
    @EndpointInject(uri =
"mock:log:eu.firstbird.firstbirdapi.application.consumer.firstbird-incomming-applications-end")
    private MockEndpoint mock;

...
    @Test
    public void firstbirdApplicationsConsumerContextTest() throws Exception
{
        ModelCamelContext modelCamelContext =
(ModelCamelContext)camelContext;

        camelContext.setTracing(true);
        assertEquals(true, camelContext.isTracing());

        DefaultExchange exchange = new DefaultExchange(camelContext);
        mock.expectedMessageCount(1);

       
modelCamelContext.getRouteDefinition("firstbird-incomming-applications").adviceWith(modelCamelContext,
                new AdviceWithRouteBuilder() {

                    @Override
                    public void configure() throws Exception {
                       
mockEndpoints("log:eu.firstbird.firstbirdapi.application.consumer*");
                    }
                });
...




--
View this message in context: http://camel.465427.n5.nabble.com/EndpointInject-not-working-tp5760927p5760929.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message