@Test public void testIpv4LocalRouteAdd() { RouteEntry routeEntry = new RouteEntry( Ip4Prefix.valueOf("1.1.1.0/24"), Ip4Address.valueOf("0.0.0.0")); replay(fibListener); reset(routingConfigurationService); expect(routingConfigurationService.isIpPrefixLocal( anyObject(IpPrefix.class))).andReturn(true); replay(routingConfigurationService); RouteUpdate routeUpdate = new RouteUpdate(RouteUpdate.Type.UPDATE, routeEntry); router.processRouteUpdates(Collections.singletonList(routeUpdate)); assertEquals(1, router.getRoutes4().size()); assertTrue(router.getRoutes4().contains(routeEntry)); verify(fibListener); }
@Override public Collection<RouteEntry> getRoutes4() { return routeService.getAllRoutes().get(new RouteTableId("ipv4")).stream() .map(route -> new RouteEntry(route.prefix(), route.nextHop())) .collect(Collectors.toList()); }
Router implements RoutingService { @Override public Collection<RouteEntry> getRoutes4() { return routeService.getAllRoutes().get(new RouteTableId("ipv4")).stream() .map(route -> new RouteEntry(route.prefix(), route.nextHop())) .collect(Collectors.toList()); } }
Router implements RoutingService { @Override public Collection<RouteEntry> getRoutes4() { return routeService.getAllRoutes().get(new RouteTableId("ipv4")).stream() .map(route -> new RouteEntry(route.prefix(), route.nextHop())) .collect(Collectors.toList()); }  }
Router implements RoutingService { @Override public Collection<RouteEntry> getRoutes4() { return routeService.getAllRoutes().get(new RouteTableId("ipv4")).stream() .map(route -> new RouteEntry(route.prefix(), route.nextHop())) .collect(Collectors.toList()); }  @Override void start(); @Override void addFibListener(FibListener fibListener); @Override void stop(); @Override Collection<RouteEntry> getRoutes4(); @Override Collection<RouteEntry> getRoutes6(); @Override RouteEntry getLongestMatchableRouteEntry(IpAddress ipAddress); }
Router implements RoutingService { @Override public Collection<RouteEntry> getRoutes4() { return routeService.getAllRoutes().get(new RouteTableId("ipv4")).stream() .map(route -> new RouteEntry(route.prefix(), route.nextHop())) .collect(Collectors.toList()); }  @Override void start(); @Override void addFibListener(FibListener fibListener); @Override void stop(); @Override Collection<RouteEntry> getRoutes4(); @Override Collection<RouteEntry> getRoutes6(); @Override RouteEntry getLongestMatchableRouteEntry(IpAddress ipAddress);  }