@Test void whenRouteLocated_thenNotifierInvoked() { Map<String, ZuulProperties.ZuulRoute> zuulRouteMap = underTest.locateRoutes(); verify(routedServicesNotifier, times(1)).notifyAndFlush(); }
@Override @VisibleForTesting protected LinkedHashMap<String, ZuulProperties.ZuulRoute> locateRoutes() { log.debug("Locating routes from Discovery client"); LinkedHashMap<String, ZuulProperties.ZuulRoute> routesMap = new LinkedHashMap<>(); discoveryClient.getServices().forEach( serviceId -> routesMap.putAll(createServiceRoutes(serviceId)) ); routedServicesNotifier.notifyAndFlush(); return routesMap; }
NewApimlRouteLocator extends DiscoveryClientRouteLocator { @Override @VisibleForTesting protected LinkedHashMap<String, ZuulProperties.ZuulRoute> locateRoutes() { log.debug("Locating routes from Discovery client"); LinkedHashMap<String, ZuulProperties.ZuulRoute> routesMap = new LinkedHashMap<>(); discoveryClient.getServices().forEach( serviceId -> routesMap.putAll(createServiceRoutes(serviceId)) ); routedServicesNotifier.notifyAndFlush(); return routesMap; } }
NewApimlRouteLocator extends DiscoveryClientRouteLocator { @Override @VisibleForTesting protected LinkedHashMap<String, ZuulProperties.ZuulRoute> locateRoutes() { log.debug("Locating routes from Discovery client"); LinkedHashMap<String, ZuulProperties.ZuulRoute> routesMap = new LinkedHashMap<>(); discoveryClient.getServices().forEach( serviceId -> routesMap.putAll(createServiceRoutes(serviceId)) ); routedServicesNotifier.notifyAndFlush(); return routesMap; } NewApimlRouteLocator(String servletPath, ZuulProperties properties, DiscoveryClient discoveryClient, RoutedServicesNotifier notifier); }
NewApimlRouteLocator extends DiscoveryClientRouteLocator { @Override @VisibleForTesting protected LinkedHashMap<String, ZuulProperties.ZuulRoute> locateRoutes() { log.debug("Locating routes from Discovery client"); LinkedHashMap<String, ZuulProperties.ZuulRoute> routesMap = new LinkedHashMap<>(); discoveryClient.getServices().forEach( serviceId -> routesMap.putAll(createServiceRoutes(serviceId)) ); routedServicesNotifier.notifyAndFlush(); return routesMap; } NewApimlRouteLocator(String servletPath, ZuulProperties properties, DiscoveryClient discoveryClient, RoutedServicesNotifier notifier);  }
NewApimlRouteLocator extends DiscoveryClientRouteLocator { @Override @VisibleForTesting protected LinkedHashMap<String, ZuulProperties.ZuulRoute> locateRoutes() { log.debug("Locating routes from Discovery client"); LinkedHashMap<String, ZuulProperties.ZuulRoute> routesMap = new LinkedHashMap<>(); discoveryClient.getServices().forEach( serviceId -> routesMap.putAll(createServiceRoutes(serviceId)) ); routedServicesNotifier.notifyAndFlush(); return routesMap; } NewApimlRouteLocator(String servletPath, ZuulProperties properties, DiscoveryClient discoveryClient, RoutedServicesNotifier notifier);   }