Search in sources :

Example 1 with NCSPathRouteUtil

use of org.opennms.features.topology.plugins.ncs.support.NCSPathRouteUtil in project opennms by OpenNMS.

the class NCSPathProviderTest method setUp.

@Before
public void setUp() throws Exception {
    NCSPathRouteUtil pathUtil = new NCSPathRouteUtil(new MockNCSComponentRepository(), new MockNodeDao());
    SimpleRegistry registry = new SimpleRegistry();
    registry.put("pathProviderUtil", pathUtil);
    CamelContext camel = new DefaultCamelContext(registry);
    camel.addRoutes(new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            from("direct:start").setHeader(Exchange.HTTP_URI, simple("http://localhost:10346/ncs-provider/api/space/nsas/service-management/services/884779")).to("http://dummyhost").beanRef("pathProviderUtil", "getServiceName").setHeader(Exchange.HTTP_URI, simple("http://localhost:10346/ncs-provider/api/space/nsas/eline-ptp/service-management/services/884779/servicepath?deviceA=${header.deviceA}&deviceZ=${header.deviceZ}")).to("http://dummyhost").beanRef("pathProviderUtil", "createPath");
        }
    });
    camel.start();
    m_ncsPathService = new NCSPathProviderService(camel);
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) RouteBuilder(org.apache.camel.builder.RouteBuilder) SimpleRegistry(org.apache.camel.impl.SimpleRegistry) NCSPathRouteUtil(org.opennms.features.topology.plugins.ncs.support.NCSPathRouteUtil) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Aggregations

CamelContext (org.apache.camel.CamelContext)1 RouteBuilder (org.apache.camel.builder.RouteBuilder)1 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)1 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)1 Before (org.junit.Before)1 NCSPathRouteUtil (org.opennms.features.topology.plugins.ncs.support.NCSPathRouteUtil)1