@Test void linkNoCert() { link(); }
@Override public void link(IdentityProvider entity, Bundle bundle, Bundle targetBundle) { if (entity.getType() != IdentityProviderType.FEDERATED) { return; } FederatedIdentityProviderDetail identityProviderDetail = (FederatedIdentityProviderDetail) entity.getIdentityProviderDetail(); if (identityProviderDetail != null) { Set<String> certIds = identityProviderDetail.getCertificateReferences(); Set<TrustedCert> trustedCerts = bundle.getEntities(TrustedCert.class).values() .stream() .filter(e -> certIds.contains(e.getId())) .collect(Collectors.toSet()); if (!trustedCerts.isEmpty()) { entity.setIdentityProviderDetail(new FederatedIdentityProviderDetail(trustedCerts.stream().map(TrustedCert::getName).collect(Collectors.toSet()))); } } }
IdentityProviderLinker implements EntityLinker<IdentityProvider> { @Override public void link(IdentityProvider entity, Bundle bundle, Bundle targetBundle) { if (entity.getType() != IdentityProviderType.FEDERATED) { return; } FederatedIdentityProviderDetail identityProviderDetail = (FederatedIdentityProviderDetail) entity.getIdentityProviderDetail(); if (identityProviderDetail != null) { Set<String> certIds = identityProviderDetail.getCertificateReferences(); Set<TrustedCert> trustedCerts = bundle.getEntities(TrustedCert.class).values() .stream() .filter(e -> certIds.contains(e.getId())) .collect(Collectors.toSet()); if (!trustedCerts.isEmpty()) { entity.setIdentityProviderDetail(new FederatedIdentityProviderDetail(trustedCerts.stream().map(TrustedCert::getName).collect(Collectors.toSet()))); } } } }
IdentityProviderLinker implements EntityLinker<IdentityProvider> { @Override public void link(IdentityProvider entity, Bundle bundle, Bundle targetBundle) { if (entity.getType() != IdentityProviderType.FEDERATED) { return; } FederatedIdentityProviderDetail identityProviderDetail = (FederatedIdentityProviderDetail) entity.getIdentityProviderDetail(); if (identityProviderDetail != null) { Set<String> certIds = identityProviderDetail.getCertificateReferences(); Set<TrustedCert> trustedCerts = bundle.getEntities(TrustedCert.class).values() .stream() .filter(e -> certIds.contains(e.getId())) .collect(Collectors.toSet()); if (!trustedCerts.isEmpty()) { entity.setIdentityProviderDetail(new FederatedIdentityProviderDetail(trustedCerts.stream().map(TrustedCert::getName).collect(Collectors.toSet()))); } } }  }
IdentityProviderLinker implements EntityLinker<IdentityProvider> { @Override public void link(IdentityProvider entity, Bundle bundle, Bundle targetBundle) { if (entity.getType() != IdentityProviderType.FEDERATED) { return; } FederatedIdentityProviderDetail identityProviderDetail = (FederatedIdentityProviderDetail) entity.getIdentityProviderDetail(); if (identityProviderDetail != null) { Set<String> certIds = identityProviderDetail.getCertificateReferences(); Set<TrustedCert> trustedCerts = bundle.getEntities(TrustedCert.class).values() .stream() .filter(e -> certIds.contains(e.getId())) .collect(Collectors.toSet()); if (!trustedCerts.isEmpty()) { entity.setIdentityProviderDetail(new FederatedIdentityProviderDetail(trustedCerts.stream().map(TrustedCert::getName).collect(Collectors.toSet()))); } } }  @Override Class<IdentityProvider> getEntityClass(); @Override void link(IdentityProvider entity, Bundle bundle, Bundle targetBundle); }
IdentityProviderLinker implements EntityLinker<IdentityProvider> { @Override public void link(IdentityProvider entity, Bundle bundle, Bundle targetBundle) { if (entity.getType() != IdentityProviderType.FEDERATED) { return; } FederatedIdentityProviderDetail identityProviderDetail = (FederatedIdentityProviderDetail) entity.getIdentityProviderDetail(); if (identityProviderDetail != null) { Set<String> certIds = identityProviderDetail.getCertificateReferences(); Set<TrustedCert> trustedCerts = bundle.getEntities(TrustedCert.class).values() .stream() .filter(e -> certIds.contains(e.getId())) .collect(Collectors.toSet()); if (!trustedCerts.isEmpty()) { entity.setIdentityProviderDetail(new FederatedIdentityProviderDetail(trustedCerts.stream().map(TrustedCert::getName).collect(Collectors.toSet()))); } } }  @Override Class<IdentityProvider> getEntityClass(); @Override void link(IdentityProvider entity, Bundle bundle, Bundle targetBundle);  }