ClassPathResourceManage implements Manage { @Override public Set<EntityMetaData> identityProvidersByAuthenticatingAuthority(String authenticatingAuthority) { EntityMetaData idp = identityProviderByEntityId(authenticatingAuthority); String institutionId = idp.getInstitutionId(); if (StringUtils.hasText(institutionId)) { return identityProviders().stream().filter(md -> institutionId.equals(md.getInstitutionId())).collect (toSet()); } else { return Sets.newHashSet(idp); } } ClassPathResourceManage(); @Override List<EntityMetaData> serviceProviders(); @Override List<EntityMetaData> identityProviders(); @Override Set<EntityMetaData> identityProvidersByAuthenticatingAuthority(String authenticatingAuthority); @Override Set<EntityMetaData> serviceProvidersByInstitutionId(String institutionId); @Override Optional<EntityMetaData> serviceProviderOptionalByEntityId(String entityId); @Override Optional<EntityMetaData> identityProviderOptionalByEntityId(String entityId); @Override Map<String, EntityMetaData> identityProvidersByEntityIds(Collection<String> entityIds); @Override Map<String, EntityMetaData> serviceProvidersByEntityIds(Collection<String> entityIds); @Override EntityMetaData serviceProviderByEntityId(String entityId); @Override EntityMetaData identityProviderByEntityId(String entityId); void allowAll(boolean allowAll);  }
@Test public void testIdentityProvidersByAuthenticatingAuthority() throws Exception { Set<EntityMetaData> idps = manage.identityProvidersByAuthenticatingAuthority("https: assertEquals(1, idps.size()); }
@Test(expected = PolicyIdpAccessUnknownIdentityProvidersException.class) public void testIdentityProvidersByAuthenticatingAuthorityNonExistentIdp() throws Exception { manage.identityProvidersByAuthenticatingAuthority("no"); }