camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ascetic <>
Subject How to mock a predicate in existing route?
Date Wed, 18 Jun 2014 08:08:34 GMT
Hello. I have a route

                                        .beanRef("jmsSlrLogger", "handle")

And i need to write a unit test to test the flow. Here a part of my test

ModelCamelContext tempModelCamelContext = (ModelCamelContext) camelContext;
        RouteDefinition tempRouteDefinition =
        tempRouteDefinition.adviceWith(tempModelCamelContext, new
AdviceWithRouteBuilder() {
            public void configure() throws Exception {
                //weaveById("slrBookPredicate").replace(); //with
                weaveById("slrDBLogger").replace().bean(slrDBLogger); //mock

I want to mock all used processors and predicates.
With processors everything works fine - i'm just replacing them the the
mocks. But when it comes to predicates i have a problems. How can i do that?
May be i should not replace them, and where is another solution exists?

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message