Add a system.out.println(wsUrl) so you can see that the url has been
resolved and spring have invoked the afterPropertiesSet. BEFORE the
adviceWith is being invoked in your test.



On Mon, Dec 13, 2010 at 2:55 PM, John <[email protected]> wrote:
>
> My application has a route defined like:
>
> public MyRoute extends RouteBuilder implements InitializingBean,
> DisposableBean
> {
>    private String host;
>    private String user;
>    private String pw;
>
>    private String wsUrl;
>
>    afterPropertiesSet()
>    {
>        wsUrl = "http://"; + host + "/some_ws" + "?username=" + user +
> "&password=" + pw;
>    }
>
>    public void configure()
>    {

Add System.out here!!!


>        from("activemq:somequeue")
>            .bean("someBean")
>            .to(wsUrl);
>    }
> }
>
> In my spring xml I define:
>
> <camelContext xmlns="http://camel.apache.org/schema/spring"; trace="true">
>    <camel:routeBuilder ref="myRoute"/>
> </camelContext>
>
> <bean name="myRoute" class="com.MyRoute">
>    <property name="host" value="${myroute.host}" />
>    <property name="user" value="${myroute.user}" />
>    <property name="pw" value="${myroute.pw}" />
> </bean>
>
> So I'm trying to create a unit test with a mock endpoint for the web service
> call in the route. To do that I'm attempting to add the interceptor via
> adviceWith that I showed above. I can't get the interceptor to actually work
> though when my original route uses the wsUrl variable. If I replace wsUrl
> with the String "http://some_stuff"; the interceptor works fine.
>
> Thanks,
>
> -john
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/interceptSendToEndpoint-with-dynamic-endpoint-tp3301978p3303122.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to