@Test public void detect() { String name = "yass"; List<Route> routes = Arrays.asList(routeWithLocation(name), routeWithLocation("https: routeWithLocation("http: Mockito.when(routeLocatorMock.getRoutes()).thenReturn(routes); Set<Relationship> result = detector.detect(); Component expectedComponent = Component.of(name, ComponentType.HTTP_APPLICATION); Set<Relationship> expected = new HashSet<>(Arrays.asList(Dependency.on(expectedComponent))); Assertions.assertThat(result).isEqualTo(expected); }
@Override public Set<Relationship> detect() { return routeLocator.getRoutes().stream() .filter(this::containsComponentName) .map(this::createDependency) .collect(Collectors.toSet()); }
ZuulRouteRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { return routeLocator.getRoutes().stream() .filter(this::containsComponentName) .map(this::createDependency) .collect(Collectors.toSet()); } }
ZuulRouteRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { return routeLocator.getRoutes().stream() .filter(this::containsComponentName) .map(this::createDependency) .collect(Collectors.toSet()); } ZuulRouteRelationshipDetector(RouteLocator routeLocator); }
ZuulRouteRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { return routeLocator.getRoutes().stream() .filter(this::containsComponentName) .map(this::createDependency) .collect(Collectors.toSet()); } ZuulRouteRelationshipDetector(RouteLocator routeLocator); @Override Set<Relationship> detect(); }
ZuulRouteRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { return routeLocator.getRoutes().stream() .filter(this::containsComponentName) .map(this::createDependency) .collect(Collectors.toSet()); } ZuulRouteRelationshipDetector(RouteLocator routeLocator); @Override Set<Relationship> detect();  }