You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Müller <ch...@gmail.com> on 2013/03/01 03:00:59 UTC

Re: Issue Replacing a component with Mock in Camel Context

First of all, you should use
from("direct:eventMessageList").routeId("PseudoEventQueue")
instead of
from("direct:eventMessageList").id("PseudoEventQueue")

And in your test method, you can do
        context.getRouteDefinition("PseudoEventQueue").adviceWith(context,
new RouteBuilder() {
            public void configure() throws Exception {
                interceptSendToEndpoint("jms:queue:foo")
                    .skipSendToOriginalEndpoint()
                    .to("mock:foo");
            }
        });

as described here:
http://camel.apache.org/advicewith.html

Will this work?

Best,
Christian

On Tue, Feb 26, 2013 at 10:27 PM, shyenuganti <sh...@gmail.com> wrote:

> context.resolveEndpoint is not availble on both the regular CamelContext or
> the ModelCamelContext in 2.10.3. Is the method deprecated?
>
> I am using @EndpointInject to get the resolve the endpoint.
>
> But still the assertion fails in my case although everything seems to work.
> Is there any thing that I doing wrong in my example above?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Issue-Replacing-a-component-with-Mock-in-Camel-Context-tp5728195p5728200.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--