@Test public void afterWithEmptyAttributes(@Mock Attribute attribute) throws JobExecutionException { entity = new GroupTO(); when(connectorObj.getAttributeByName(anyString())).thenReturn(attribute); when(externalResource.getProvision(any(AnyType.class))).thenAnswer(ic -> Optional.of(mock(Provision.class))); ldapMembershipPullActions.after(profile, syncDelta, entity, result); assertEquals(List.of(), attribute.getValue()); }
@Override public void after( final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final EntityTO entity, final ProvisioningReport result) throws JobExecutionException { if (!(entity instanceof GroupTO)) { super.after(profile, delta, entity, result); } Optional<? extends Provision> provision = profile.getTask().getResource().getProvision(anyTypeDAO.findUser()). filter(p -> p.getMapping() != null); if (provision.isEmpty()) { super.after(profile, delta, entity, result); } getMembAttrValues(delta, profile.getConnector()).forEach(membValue -> { Optional<PullMatch> match = inboundMatcher.match( anyTypeDAO.findUser(), membValue.toString(), profile.getTask().getResource(), profile.getConnector()); if (match.isPresent()) { Set<String> memb = membershipsAfter.get(match.get().getAny().getKey()); if (memb == null) { memb = new HashSet<>(); membershipsAfter.put(match.get().getAny().getKey(), memb); } memb.add(entity.getKey()); } else { LOG.warn("Could not find matching user for {}", membValue); } }); }
LDAPMembershipPullActions extends SchedulingPullActions { @Override public void after( final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final EntityTO entity, final ProvisioningReport result) throws JobExecutionException { if (!(entity instanceof GroupTO)) { super.after(profile, delta, entity, result); } Optional<? extends Provision> provision = profile.getTask().getResource().getProvision(anyTypeDAO.findUser()). filter(p -> p.getMapping() != null); if (provision.isEmpty()) { super.after(profile, delta, entity, result); } getMembAttrValues(delta, profile.getConnector()).forEach(membValue -> { Optional<PullMatch> match = inboundMatcher.match( anyTypeDAO.findUser(), membValue.toString(), profile.getTask().getResource(), profile.getConnector()); if (match.isPresent()) { Set<String> memb = membershipsAfter.get(match.get().getAny().getKey()); if (memb == null) { memb = new HashSet<>(); membershipsAfter.put(match.get().getAny().getKey(), memb); } memb.add(entity.getKey()); } else { LOG.warn("Could not find matching user for {}", membValue); } }); } }
LDAPMembershipPullActions extends SchedulingPullActions { @Override public void after( final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final EntityTO entity, final ProvisioningReport result) throws JobExecutionException { if (!(entity instanceof GroupTO)) { super.after(profile, delta, entity, result); } Optional<? extends Provision> provision = profile.getTask().getResource().getProvision(anyTypeDAO.findUser()). filter(p -> p.getMapping() != null); if (provision.isEmpty()) { super.after(profile, delta, entity, result); } getMembAttrValues(delta, profile.getConnector()).forEach(membValue -> { Optional<PullMatch> match = inboundMatcher.match( anyTypeDAO.findUser(), membValue.toString(), profile.getTask().getResource(), profile.getConnector()); if (match.isPresent()) { Set<String> memb = membershipsAfter.get(match.get().getAny().getKey()); if (memb == null) { memb = new HashSet<>(); membershipsAfter.put(match.get().getAny().getKey(), memb); } memb.add(entity.getKey()); } else { LOG.warn("Could not find matching user for {}", membValue); } }); }  }
LDAPMembershipPullActions extends SchedulingPullActions { @Override public void after( final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final EntityTO entity, final ProvisioningReport result) throws JobExecutionException { if (!(entity instanceof GroupTO)) { super.after(profile, delta, entity, result); } Optional<? extends Provision> provision = profile.getTask().getResource().getProvision(anyTypeDAO.findUser()). filter(p -> p.getMapping() != null); if (provision.isEmpty()) { super.after(profile, delta, entity, result); } getMembAttrValues(delta, profile.getConnector()).forEach(membValue -> { Optional<PullMatch> match = inboundMatcher.match( anyTypeDAO.findUser(), membValue.toString(), profile.getTask().getResource(), profile.getConnector()); if (match.isPresent()) { Set<String> memb = membershipsAfter.get(match.get().getAny().getKey()); if (memb == null) { memb = new HashSet<>(); membershipsAfter.put(match.get().getAny().getKey(), memb); } memb.add(entity.getKey()); } else { LOG.warn("Could not find matching user for {}", membValue); } }); }  @Transactional(readOnly = true) @Override void beforeUpdate(
            final ProvisioningProfile<?, ?> profile,
            final SyncDelta delta,
            final EntityTO entity,
            final AnyUR anyUR); @Override void after(
            final ProvisioningProfile<?, ?> profile,
            final SyncDelta delta,
            final EntityTO entity,
            final ProvisioningReport result); @Override void afterAll(final ProvisioningProfile<?, ?> profile); }
LDAPMembershipPullActions extends SchedulingPullActions { @Override public void after( final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final EntityTO entity, final ProvisioningReport result) throws JobExecutionException { if (!(entity instanceof GroupTO)) { super.after(profile, delta, entity, result); } Optional<? extends Provision> provision = profile.getTask().getResource().getProvision(anyTypeDAO.findUser()). filter(p -> p.getMapping() != null); if (provision.isEmpty()) { super.after(profile, delta, entity, result); } getMembAttrValues(delta, profile.getConnector()).forEach(membValue -> { Optional<PullMatch> match = inboundMatcher.match( anyTypeDAO.findUser(), membValue.toString(), profile.getTask().getResource(), profile.getConnector()); if (match.isPresent()) { Set<String> memb = membershipsAfter.get(match.get().getAny().getKey()); if (memb == null) { memb = new HashSet<>(); membershipsAfter.put(match.get().getAny().getKey(), memb); } memb.add(entity.getKey()); } else { LOG.warn("Could not find matching user for {}", membValue); } }); }  @Transactional(readOnly = true) @Override void beforeUpdate(
            final ProvisioningProfile<?, ?> profile,
            final SyncDelta delta,
            final EntityTO entity,
            final AnyUR anyUR); @Override void after(
            final ProvisioningProfile<?, ?> profile,
            final SyncDelta delta,
            final EntityTO entity,
            final ProvisioningReport result); @Override void afterAll(final ProvisioningProfile<?, ?> profile);  }