CamelRoutesEndpoint { @ReadOperation public List<RouteEndpointInfo> readRoutes() { return getRoutesInfo(); } CamelRoutesEndpoint(CamelContext camelContext, CamelRoutesEndpointProperties properties); @ReadOperation List<RouteEndpointInfo> readRoutes(); @ReadOperation Object doReadAction(@Selector String id, @Selector ReadAction action); @WriteOperation void doWriteAction(@Selector String id, @Selector WriteAction action, @Nullable TimeInfo timeInfo);  }
@Test public void testRoutesEndpoint() throws Exception { List<RouteEndpointInfo> routes = endpoint.readRoutes(); assertFalse(routes.isEmpty()); assertEquals(routes.size(), camelContext.getRoutes().size()); assertTrue(routes.stream().anyMatch(r -> "foo-route".equals(r.getId()))); assertTrue(routes.stream().anyMatch(r -> "foo-route-group".equals(r.getGroup()))); assertTrue(routes.stream().anyMatch(r -> r.getProperties().containsKey("key1") && "val1".equals(r.getProperties().get("key1")))); assertTrue(routes.stream().anyMatch(r -> r.getProperties().containsKey("key2") && "val2".equals(r.getProperties().get("key2")))); }