Package com.netflix.suro.routing.RoutingMap

Examples of com.netflix.suro.routing.RoutingMap.Route


    @Test
    public void generateRoutingInfo() throws Exception {
        RoutingInfo route1 = new RoutingInfo(
            ImmutableList.<Route>of(
                new Route(
                    "sink2",
                    new XPathFilter("xpath(\"//customerInfo/country\") =~ \"(?i)^US\"", new JsonMapConverter()),
                    null
                ),

                new Route(
                    "sink3",
                    new XPathFilter("xpath(\"//responseInfo/status\") >= 400", new JsonMapConverter()),
                    null
                )
            ),
View Full Code Here


        RoutingInfo info = map.get(routingKey);
        List<Route> routes = info.getWhere();
        assertEquals("There should be only one sink", 1, routes.size());

        Route route = routes.get(0);
        assertEquals("sink1", route.getSink());

        Map<String, Map<String, String>> obj = Maps.newHashMap();
        obj.put("foo", ImmutableMap.of("bar", "tESt"));

        MessageContainer container = Mockito.mock(MessageContainer.class);
        Mockito.when(container.getEntity(Map.class)).thenReturn(obj);
        assertEquals(true, route.getFilter().doFilter(container));
    }
View Full Code Here

TOP

Related Classes of com.netflix.suro.routing.RoutingMap.Route

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.