@Test public void usingRemoteTokenServicesWithCustomName() { ResourceServerTokenServices tokenService = new RemoteTokenServices(); detector = new AuthorizationServerRelationshipDetector(tokenService); String customName = "authz"; detector.setDefaultName(customName); Set<Relationship> expected = new HashSet<>( Arrays.asList(Dependency.on(Component.of(customName, ComponentType.HTTP_APPLICATION)))); Set<Relationship> result = detector.detect(); Assertions.assertThat(result).isEqualTo(expected); }
@Override public Set<Relationship> detect() { if (tokenService instanceof RemoteTokenServices || tokenService instanceof UserInfoTokenServices) { return Dependency.on(Component.of(getDefaultName(), ComponentType.HTTP_APPLICATION)).asRelationshipSet(); } return Collections.emptySet(); }
AuthorizationServerRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (tokenService instanceof RemoteTokenServices || tokenService instanceof UserInfoTokenServices) { return Dependency.on(Component.of(getDefaultName(), ComponentType.HTTP_APPLICATION)).asRelationshipSet(); } return Collections.emptySet(); } }
AuthorizationServerRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (tokenService instanceof RemoteTokenServices || tokenService instanceof UserInfoTokenServices) { return Dependency.on(Component.of(getDefaultName(), ComponentType.HTTP_APPLICATION)).asRelationshipSet(); } return Collections.emptySet(); } AuthorizationServerRelationshipDetector(ResourceServerTokenServices tokenService); }
AuthorizationServerRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (tokenService instanceof RemoteTokenServices || tokenService instanceof UserInfoTokenServices) { return Dependency.on(Component.of(getDefaultName(), ComponentType.HTTP_APPLICATION)).asRelationshipSet(); } return Collections.emptySet(); } AuthorizationServerRelationshipDetector(ResourceServerTokenServices tokenService); @Override Set<Relationship> detect(); }
AuthorizationServerRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (tokenService instanceof RemoteTokenServices || tokenService instanceof UserInfoTokenServices) { return Dependency.on(Component.of(getDefaultName(), ComponentType.HTTP_APPLICATION)).asRelationshipSet(); } return Collections.emptySet(); } AuthorizationServerRelationshipDetector(ResourceServerTokenServices tokenService); @Override Set<Relationship> detect();  }