@Test
public void testBusInjectedBySpring() throws Exception {
CamelContext camelContext = (CamelContext) ctx.getBean("camel");
CxfEndpoint endpoint = (CxfEndpoint)camelContext.getEndpoint("cxf:bean:routerEndpoint");
assertEquals("Get a wrong endpoint uri", "cxf://bean:routerEndpoint", endpoint.getEndpointUri());
Bus cxf1 = endpoint.getBus();
assertEquals(cxf1, ctx.getBean("cxf1"));
assertEquals(cxf1, endpoint.getBus());
assertEquals("barf", endpoint.getBus().getProperty("foo"));
endpoint = (CxfEndpoint)camelContext.getEndpoint("cxf:bean:serviceEndpoint");
assertEquals("Get a wrong endpoint uri", "cxf://bean:serviceEndpoint", endpoint.getEndpointUri());
Bus cxf2 = endpoint.getBus();
assertEquals(cxf2, ctx.getBean("cxf2"));
assertEquals(cxf2, endpoint.getBus());
assertEquals("snarf", endpoint.getBus().getProperty("foo"));
}