http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java index 0ccbe14..ca94e16 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.syncope.common.lib.SyncopeClientCompositeException; import org.apache.syncope.common.lib.SyncopeClientException; @@ -38,7 +37,6 @@ import org.apache.syncope.common.lib.to.AttrTO; import org.apache.syncope.common.lib.to.MembershipTO; import org.apache.syncope.common.lib.to.RelationshipTO; import org.apache.syncope.common.lib.types.ClientExceptionType; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.common.lib.types.PatchOperation; import org.apache.syncope.common.lib.types.ResourceOperation; @@ -96,11 +94,6 @@ abstract class AbstractAnyDataBinder { protected static final Logger LOG = LoggerFactory.getLogger(AbstractAnyDataBinder.class); - private static final IntMappingType[] FOR_MANDATORY = new IntMappingType[] { - IntMappingType.AnyObjectPlainSchema, IntMappingType.AnyObjectDerivedSchema, - IntMappingType.UserPlainSchema, IntMappingType.UserDerivedSchema, - IntMappingType.GroupPlainSchema, IntMappingType.GroupDerivedSchema }; - @Autowired protected RealmDAO realmDAO; @@ -224,10 +217,7 @@ abstract class AbstractAnyDataBinder { if (provision != null) { for (MappingItem item : provision.getMapping().getItems()) { - if (ArrayUtils.contains(FOR_MANDATORY, item.getIntMappingType()) - && (item.getPurpose() == MappingPurpose.PROPAGATION - || item.getPurpose() == MappingPurpose.BOTH)) { - + if ((item.getPurpose() == MappingPurpose.PROPAGATION || item.getPurpose() == MappingPurpose.BOTH)) { List<PlainAttrValue> values = mappingManager.getIntValues( provision, item, Collections.<Any<?>>singletonList(any)); if (values.isEmpty() && JexlUtils.evaluateMandatoryCondition(item.getMandatoryCondition(), any)) { @@ -351,9 +341,7 @@ abstract class AbstractAnyDataBinder { for (MappingItem mapItem : MappingManagerImpl.getPropagationMappingItems(resource.getProvision(any.getType()))) { - if (schema.getKey().equals(mapItem.getIntAttrName()) - && mapItem.getIntMappingType() == anyUtils.plainIntMappingType()) { - + if (schema.getKey().equals(mapItem.getIntAttrName())) { propByRes.add(ResourceOperation.UPDATE, resource.getKey()); if (mapItem.isConnObjectKey() && !attr.getValuesAsStrings().isEmpty()) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java index eb0c328..a9de5bd 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java @@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.core.provisioning.api.data.NotificationDataBinder; import org.apache.syncope.common.lib.to.NotificationTO; +import org.apache.syncope.common.lib.types.AnyTypeKind; import org.apache.syncope.common.lib.types.ClientExceptionType; import org.apache.syncope.core.persistence.api.entity.EntityFactory; import org.apache.syncope.core.persistence.api.entity.Notification; @@ -33,7 +34,9 @@ import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO; import org.apache.syncope.core.persistence.api.dao.MailTemplateDAO; import org.apache.syncope.core.persistence.api.entity.AnyAbout; import org.apache.syncope.core.persistence.api.entity.AnyType; +import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory; import org.apache.syncope.core.persistence.api.entity.MailTemplate; +import org.apache.syncope.core.provisioning.api.IntAttrNameParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -55,6 +58,9 @@ public class NotificationDataBinderImpl implements NotificationDataBinder { @Autowired private EntityFactory entityFactory; + @Autowired + private AnyUtilsFactory anyUtilsFactory; + @Override public NotificationTO getNotificationTO(final Notification notification) { NotificationTO result = new NotificationTO(); @@ -118,5 +124,8 @@ public class NotificationDataBinderImpl implements NotificationDataBinder { return notificationTO.getAbouts().containsKey(anyAbout.getAnyType().getKey()); } }); + + // 3. verify recipientAttrName + IntAttrNameParser.parse(notification.getRecipientAttrName(), anyUtilsFactory, AnyTypeKind.USER); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java index e09972f..ddf5a14 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java @@ -31,7 +31,7 @@ import org.apache.syncope.common.lib.to.MappingTO; import org.apache.syncope.common.lib.to.ProvisionTO; import org.apache.syncope.common.lib.to.ResourceTO; import org.apache.syncope.common.lib.types.ClientExceptionType; -import org.apache.syncope.common.lib.types.IntMappingType; +import org.apache.syncope.common.lib.types.SchemaType; import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO; import org.apache.syncope.core.persistence.api.dao.ConnInstanceDAO; import org.apache.syncope.core.persistence.api.dao.PolicyDAO; @@ -48,11 +48,14 @@ import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO; import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO; import org.apache.syncope.core.persistence.api.entity.AnyType; import org.apache.syncope.core.persistence.api.entity.AnyTypeClass; +import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory; import org.apache.syncope.core.persistence.api.entity.DerSchema; import org.apache.syncope.core.persistence.api.entity.PlainSchema; import org.apache.syncope.core.persistence.api.entity.VirSchema; import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy; import org.apache.syncope.core.persistence.api.entity.resource.Provision; +import org.apache.syncope.core.provisioning.api.IntAttrNameParser; +import org.apache.syncope.core.provisioning.api.IntAttrNameParser.IntAttrName; import org.apache.syncope.core.provisioning.api.data.ResourceDataBinder; import org.apache.syncope.core.provisioning.api.utils.EntityUtils; import org.identityconnectors.framework.common.objects.ObjectClass; @@ -86,6 +89,9 @@ public class ResourceDataBinderImpl implements ResourceDataBinder { @Autowired private EntityFactory entityFactory; + @Autowired + private AnyUtilsFactory anyUtilsFactory; + @Override public ExternalResource create(final ResourceTO resourceTO) { return update(entityFactory.newEntity(ExternalResource.class), resourceTO); @@ -259,44 +265,37 @@ public class ResourceDataBinderImpl implements ResourceDataBinder { SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing); for (MappingItemTO itemTO : mappingTO.getItems()) { - if (itemTO == null || itemTO.getIntMappingType() == null) { - LOG.error("Null {} or missing {}", - MappingItemTO.class.getSimpleName(), IntMappingType.class.getSimpleName()); - invalidMapping.getElements().add( - "Null " + MappingItemTO.class.getSimpleName() - + " or missing " + IntMappingType.class.getSimpleName()); + if (itemTO == null) { + LOG.error("Null {}", MappingItemTO.class.getSimpleName()); + invalidMapping.getElements().add("Null " + MappingItemTO.class.getSimpleName()); } else { if (itemTO.getIntAttrName() == null) { - if (IntMappingType.getEmbedded().contains(itemTO.getIntMappingType())) { - itemTO.setIntAttrName(itemTO.getIntMappingType().toString()); - } else { - requiredValuesMissing.getElements().add("intAttrName"); - scce.addException(requiredValuesMissing); - } + requiredValuesMissing.getElements().add("intAttrName"); + scce.addException(requiredValuesMissing); } - boolean allowed; - switch (itemTO.getIntMappingType()) { - case UserPlainSchema: - case GroupPlainSchema: - case AnyObjectPlainSchema: - allowed = allowedSchemas.getPlainSchemas().contains(itemTO.getIntAttrName()); - break; - - case UserDerivedSchema: - case GroupDerivedSchema: - case AnyObjectDerivedSchema: - allowed = allowedSchemas.getDerSchemas().contains(itemTO.getIntAttrName()); - break; - - case UserVirtualSchema: - case GroupVirtualSchema: - case AnyObjectVirtualSchema: - allowed = allowedSchemas.getVirSchemas().contains(itemTO.getIntAttrName()); - break; - - default: - allowed = true; + IntAttrName intAttrName = IntAttrNameParser.parse( + itemTO.getIntAttrName(), + anyUtilsFactory, + mapping.getProvision().getAnyType().getKind()); + + boolean allowed = true; + if (intAttrName.getSchemaType() != null) { + switch (intAttrName.getSchemaType()) { + case PLAIN: + allowed = allowedSchemas.getPlainSchemas().contains(itemTO.getIntAttrName()); + break; + + case DERIVED: + allowed = allowedSchemas.getDerSchemas().contains(itemTO.getIntAttrName()); + break; + + case VIRTUAL: + allowed = allowedSchemas.getVirSchemas().contains(itemTO.getIntAttrName()); + break; + + default: + } } if (allowed) { @@ -314,6 +313,13 @@ public class ResourceDataBinderImpl implements ResourceDataBinder { BeanUtils.copyProperties(itemTO, item, MAPPINGITEM_IGNORE_PROPERTIES); item.setMapping(mapping); if (item.isConnObjectKey()) { + if (intAttrName.getSchemaType() == SchemaType.VIRTUAL) { + throw new IllegalArgumentException("Virtual attributes cannot be set as ConnObjectKey"); + } + if ("password".equals(intAttrName.getField())) { + throw new IllegalArgumentException("Password attributes cannot be set as ConnObjectKey"); + } + mapping.setConnObjectKeyItem(item); } else { mapping.add(item); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java index af872c1..d0229f9 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java @@ -33,7 +33,6 @@ import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.AuditElements; import org.apache.syncope.common.lib.types.AuditElements.Result; import org.apache.syncope.common.lib.types.AuditLoggerName; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.to.AnyObjectTO; import org.apache.syncope.common.lib.to.ProvisioningResult; import org.apache.syncope.common.lib.types.AnyTypeKind; @@ -63,10 +62,13 @@ import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO; import org.apache.syncope.core.persistence.api.entity.Any; import org.apache.syncope.core.persistence.api.entity.AnyAbout; import org.apache.syncope.core.persistence.api.entity.AnyType; +import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory; import org.apache.syncope.core.persistence.api.entity.DerSchema; import org.apache.syncope.core.persistence.api.entity.VirSchema; import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject; import org.apache.syncope.core.provisioning.api.DerAttrHandler; +import org.apache.syncope.core.provisioning.api.IntAttrNameParser; +import org.apache.syncope.core.provisioning.api.IntAttrNameParser.IntAttrName; import org.apache.syncope.core.provisioning.api.VirAttrHandler; import org.apache.syncope.core.provisioning.api.data.AnyObjectDataBinder; import org.apache.syncope.core.provisioning.api.notification.NotificationManager; @@ -150,6 +152,9 @@ public class NotificationManagerImpl implements NotificationManager { @Autowired private EntityFactory entityFactory; + @Autowired + private AnyUtilsFactory anyUtilsFactory; + @Transactional(readOnly = true) @Override public long getMaxRetries() { @@ -190,8 +195,7 @@ public class NotificationManagerImpl implements NotificationManager { for (User recipient : recipients) { virAttrHander.getValues(recipient); - String email = getRecipientEmail(notification.getRecipientAttrType(), - notification.getRecipientAttrName(), recipient); + String email = getRecipientEmail(notification.getRecipientAttrName(), recipient); if (email == null) { LOG.warn("{} cannot be notified: {} not found", recipient, notification.getRecipientAttrName()); } else { @@ -339,43 +343,43 @@ public class NotificationManagerImpl implements NotificationManager { return notifications; } - private String getRecipientEmail( - final IntMappingType recipientAttrType, final String recipientAttrName, final User user) { - + private String getRecipientEmail(final String recipientAttrName, final User user) { String email = null; - switch (recipientAttrType) { - case Username: - email = user.getUsername(); - break; + IntAttrName intAttrName = IntAttrNameParser.parse(recipientAttrName, anyUtilsFactory, AnyTypeKind.USER); - case UserPlainSchema: - UPlainAttr attr = user.getPlainAttr(recipientAttrName); - if (attr != null) { - email = attr.getValuesAsStrings().isEmpty() ? null : attr.getValuesAsStrings().get(0); - } - break; - - case UserDerivedSchema: - DerSchema schema = derSchemaDAO.find(recipientAttrName); - if (schema == null) { - LOG.warn("Ignoring non existing {} {}", DerSchema.class.getSimpleName(), recipientAttrName); - } else { - email = derAttrHander.getValue(user, schema); - } - break; - - case UserVirtualSchema: - VirSchema virSchema = virSchemaDAO.find(recipientAttrName); - if (virSchema == null) { - LOG.warn("Ignoring non existing {} {}", VirSchema.class.getSimpleName(), recipientAttrName); - } else { - List<String> virAttrValues = virAttrHander.getValues(user, virSchema); - email = virAttrValues.isEmpty() ? null : virAttrValues.get(0); - } - break; + if ("username".equals(intAttrName.getField())) { + email = user.getUsername(); + } else if (intAttrName.getSchemaType() != null) { + switch (intAttrName.getSchemaType()) { + case PLAIN: + UPlainAttr attr = user.getPlainAttr(recipientAttrName); + if (attr != null) { + email = attr.getValuesAsStrings().isEmpty() ? null : attr.getValuesAsStrings().get(0); + } + break; + + case DERIVED: + DerSchema schema = derSchemaDAO.find(recipientAttrName); + if (schema == null) { + LOG.warn("Ignoring non existing {} {}", DerSchema.class.getSimpleName(), recipientAttrName); + } else { + email = derAttrHander.getValue(user, schema); + } + break; + + case VIRTUAL: + VirSchema virSchema = virSchemaDAO.find(recipientAttrName); + if (virSchema == null) { + LOG.warn("Ignoring non existing {} {}", VirSchema.class.getSimpleName(), recipientAttrName); + } else { + List<String> virAttrValues = virAttrHander.getValues(user, virSchema); + email = virAttrValues.isEmpty() ? null : virAttrValues.get(0); + } + break; - default: + default: + } } return email; http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PullUtils.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PullUtils.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PullUtils.java index 995f483..a2c9271 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PullUtils.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PullUtils.java @@ -47,6 +47,8 @@ import org.apache.syncope.core.persistence.api.entity.resource.Provision; import org.apache.syncope.core.persistence.api.entity.task.ProvisioningTask; import org.apache.syncope.core.persistence.api.entity.user.User; import org.apache.syncope.core.provisioning.api.Connector; +import org.apache.syncope.core.provisioning.api.IntAttrNameParser; +import org.apache.syncope.core.provisioning.api.IntAttrNameParser.IntAttrName; import org.apache.syncope.core.provisioning.api.data.MappingItemTransformer; import org.identityconnectors.framework.common.objects.Attribute; import org.identityconnectors.framework.common.objects.AttributeUtil; @@ -155,10 +157,10 @@ public class PullUtils { return result; } - private AnyDAO<?> getAnyDAO(final MappingItem connObjectKeyItem) { - return AnyTypeKind.USER == connObjectKeyItem.getIntMappingType().getAnyTypeKind() + private AnyDAO<?> getAnyDAO(final AnyTypeKind anyTypeKind) { + return AnyTypeKind.USER == anyTypeKind ? userDAO - : AnyTypeKind.ANY_OBJECT == connObjectKeyItem.getIntMappingType().getAnyTypeKind() + : AnyTypeKind.ANY_OBJECT == anyTypeKind ? anyObjectDAO : groupDAO; } @@ -181,72 +183,70 @@ public class PullUtils { } } - switch (connObjectKeyItem.getIntMappingType()) { - case UserPlainSchema: - case GroupPlainSchema: - case AnyObjectPlainSchema: - PlainAttrValue value = anyUtils.newPlainAttrValue(); + IntAttrName intAttrName = IntAttrNameParser.parse( + connObjectKeyItem.getIntAttrName(), + anyUtilsFactory, + provision.getAnyType().getKind()); + + if (intAttrName.getField() != null) { + switch (intAttrName.getField()) { + case "key": + Any<?> any = getAnyDAO(provision.getAnyType().getKind()).find(transfUid); + if (any != null) { + result.add(any.getKey()); + } + break; - PlainSchema schema = plainSchemaDAO.find(connObjectKeyItem.getIntAttrName()); - if (schema == null) { - value.setStringValue(transfUid); - } else { - try { - value.parseValue(schema, transfUid); - } catch (ParsingValidationException e) { - LOG.error("While parsing provided __UID__ {}", transfUid, e); - value.setStringValue(transfUid); + case "username": + User user = userDAO.findByUsername(transfUid); + if (user != null) { + result.add(user.getKey()); } - } + break; - List<? extends Any<?>> anys = - getAnyDAO(connObjectKeyItem).findByAttrValue(connObjectKeyItem.getIntAttrName(), value); - for (Any<?> any : anys) { - result.add(any.getKey()); - } - break; - - case UserDerivedSchema: - case GroupDerivedSchema: - case AnyObjectDerivedSchema: - anys = getAnyDAO(connObjectKeyItem).findByDerAttrValue(connObjectKeyItem.getIntAttrName(), transfUid); - for (Any<?> any : anys) { - result.add(any.getKey()); - } - break; - - case UserKey: - case GroupKey: - case AnyObjectKey: - Any<?> any = getAnyDAO(connObjectKeyItem).find(transfUid); - if (any != null) { - result.add(any.getKey()); - } - break; + case "name": + Group group = groupDAO.findByName(transfUid); + if (group != null) { + result.add(group.getKey()); + } + AnyObject anyObject = anyObjectDAO.findByName(transfUid); + if (anyObject != null) { + result.add(anyObject.getKey()); + } + break; + } + } else if (intAttrName.getSchemaType() != null) { + switch (intAttrName.getSchemaType()) { + case PLAIN: + PlainAttrValue value = anyUtils.newPlainAttrValue(); - case Username: - User user = userDAO.findByUsername(transfUid); - if (user != null) { - result.add(user.getKey()); - } - break; + PlainSchema schema = plainSchemaDAO.find(intAttrName.getSchemaName()); + if (schema == null) { + value.setStringValue(transfUid); + } else { + try { + value.parseValue(schema, transfUid); + } catch (ParsingValidationException e) { + LOG.error("While parsing provided __UID__ {}", transfUid, e); + value.setStringValue(transfUid); + } + } - case GroupName: - Group group = groupDAO.findByName(transfUid); - if (group != null) { - result.add(group.getKey()); - } - break; + List<? extends Any<?>> anys = getAnyDAO(provision.getAnyType().getKind()). + findByAttrValue(intAttrName.getSchemaName(), value); + for (Any<?> any : anys) { + result.add(any.getKey()); + } + break; - case AnyObjectName: - AnyObject anyObject = anyObjectDAO.findByName(transfUid); - if (anyObject != null) { - result.add(anyObject.getKey()); - } - break; - - default: - LOG.error("Invalid connObjectKey type '{}'", connObjectKeyItem.getIntMappingType()); + case DERIVED: + anys = getAnyDAO(provision.getAnyType().getKind()). + findByDerAttrValue(intAttrName.getSchemaName(), transfUid); + for (Any<?> any : anys) { + result.add(any.getKey()); + } + break; + } } return result; http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java index 26f35cc..cb1612a 100644 --- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java +++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java @@ -28,7 +28,6 @@ import org.apache.syncope.common.lib.to.MappingTO; import org.apache.syncope.common.lib.to.ProvisionTO; import org.apache.syncope.common.lib.to.ResourceTO; import org.apache.syncope.common.lib.types.AnyTypeKind; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO; import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO; @@ -89,7 +88,6 @@ public class ResourceDataBinderTest extends AbstractTest { MappingItemTO item = new MappingItemTO(); item.setIntAttrName("userId"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("campo1"); item.setConnObjectKey(true); item.setMandatoryCondition("false"); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConfigurationITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConfigurationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConfigurationITCase.java index 574c147..c6bde9c 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConfigurationITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConfigurationITCase.java @@ -167,7 +167,7 @@ public class ConfigurationITCase extends AbstractITCase { assertNotNull(e.getElements()); assertEquals(1, e.getElements().size()); - assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name())); + assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidKey.name())); } } } http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConnectorITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConnectorITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConnectorITCase.java index beb4cf0..067022b 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConnectorITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ConnectorITCase.java @@ -57,7 +57,6 @@ import org.apache.syncope.common.lib.types.AnyTypeKind; import org.apache.syncope.common.lib.types.ConnConfPropSchema; import org.apache.syncope.common.lib.types.ConnConfProperty; import org.apache.syncope.common.lib.types.ConnectorCapability; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.rest.api.service.ConnectorService; import org.apache.syncope.common.rest.api.service.ResourceService; import org.apache.syncope.fit.AbstractITCase; @@ -674,7 +673,6 @@ public class ConnectorITCase extends AbstractITCase { MappingItemTO mapItem = new MappingItemTO(); mapItem.setExtAttrName("uid"); mapItem.setIntAttrName("userId"); - mapItem.setIntMappingType(IntMappingType.UserPlainSchema); mapItem.setConnObjectKey(true); mapping.setConnObjectKeyItem(mapItem); // ---------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DerSchemaITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DerSchemaITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DerSchemaITCase.java index 8597974..71a3814 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DerSchemaITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DerSchemaITCase.java @@ -142,7 +142,7 @@ public class DerSchemaITCase extends AbstractITCase { fail(); } catch (SyncopeClientException e) { assertEquals(ClientExceptionType.InvalidDerSchema, e.getType()); - assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name())); + assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidKey.name())); } } } http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java index b654ac1..a09b9bb 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java @@ -76,7 +76,6 @@ import org.apache.syncope.common.lib.types.AttrSchemaType; import org.apache.syncope.common.lib.types.BulkMembersActionType; import org.apache.syncope.common.lib.types.ClientExceptionType; import org.apache.syncope.common.lib.types.ConnectorCapability; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.common.lib.types.PatchOperation; import org.apache.syncope.common.lib.types.PropagationTaskExecStatus; @@ -882,14 +881,12 @@ public class GroupITCase extends AbstractITCase { MappingTO mapping = newLDAP.getProvision(AnyTypeKind.GROUP.name()).getMapping(); MappingItemTO connObjectKey = mapping.getConnObjectKeyItem(); - connObjectKey.setIntMappingType(IntMappingType.GroupDerivedSchema); connObjectKey.setIntAttrName("displayProperty"); connObjectKey.setPurpose(MappingPurpose.PROPAGATION); mapping.setConnObjectKeyItem(connObjectKey); mapping.setConnObjectLink("'cn=' + displayProperty + ',ou=groups,o=isp'"); MappingItemTO description = new MappingItemTO(); - description.setIntMappingType(IntMappingType.GroupKey); description.setExtAttrName("description"); description.setPurpose(MappingPurpose.BOTH); mapping.add(description); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java index 1cec39a..a89fae3 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java @@ -49,7 +49,6 @@ import org.apache.syncope.common.lib.types.AttrSchemaType; import org.apache.syncope.common.lib.types.ConnConfPropSchema; import org.apache.syncope.common.lib.types.ConnConfProperty; import org.apache.syncope.common.lib.types.ConnectorCapability; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.common.lib.types.PullMode; import org.apache.syncope.common.lib.types.SchemaType; @@ -260,7 +259,6 @@ public class MigrationITCase extends AbstractTaskITCase { MappingItemTO item = new MappingItemTO(); item.setIntAttrName("username"); - item.setIntMappingType(IntMappingType.Username); item.setExtAttrName("username"); item.setMandatoryCondition("true"); item.setPurpose(MappingPurpose.PULL); @@ -269,7 +267,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setPassword(true); item.setIntAttrName("password"); - item.setIntMappingType(IntMappingType.Password); item.setExtAttrName("__PASSWORD__"); item.setMandatoryCondition("true"); item.setPurpose(MappingPurpose.PULL); @@ -277,7 +274,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName(MIGRATION_CIPHER_ALGORITHM); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("cipherAlgorithm"); item.setMandatoryCondition("true"); item.setPurpose(MappingPurpose.PULL); @@ -285,7 +281,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("surname"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("surname"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -293,7 +288,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("email"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("email"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -301,7 +295,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("firstname"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("firstname"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -309,7 +302,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("ctype"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("type"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -317,7 +309,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("gender"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("gender"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -325,7 +316,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("loginDate"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("loginDate"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -333,7 +323,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName(MIGRATION_RESOURCES_SCHEMA); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("__RESOURCES__"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -351,7 +340,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("groupName"); - item.setIntMappingType(IntMappingType.GroupName); item.setExtAttrName("name"); item.setMandatoryCondition("true"); item.setPurpose(MappingPurpose.PULL); @@ -359,7 +347,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("show"); - item.setIntMappingType(IntMappingType.GroupPlainSchema); item.setExtAttrName("show"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -367,7 +354,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("title"); - item.setIntMappingType(IntMappingType.GroupPlainSchema); item.setExtAttrName("title"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -375,7 +361,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName("icon"); - item.setIntMappingType(IntMappingType.GroupPlainSchema); item.setExtAttrName("icon"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -383,7 +368,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName(MIGRATION_RESOURCES_SCHEMA); - item.setIntMappingType(IntMappingType.GroupPlainSchema); item.setExtAttrName("__RESOURCES__"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); @@ -391,7 +375,6 @@ public class MigrationITCase extends AbstractTaskITCase { item = new MappingItemTO(); item.setIntAttrName(MIGRATION_MEMBERSHIPS_SCHEMA); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("__MEMBERSHIPS__"); item.setMandatoryCondition("false"); item.setPurpose(MappingPurpose.PULL); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java index 97745c3..2c5b023 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java @@ -44,7 +44,6 @@ import org.apache.syncope.common.lib.to.PullTaskTO; import org.apache.syncope.common.lib.to.ExecTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.AnyTypeKind; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.LoggerType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.common.lib.types.PropagationTaskExecStatus; @@ -157,21 +156,20 @@ public class MultitenancyITCase extends AbstractITCase { MappingItemTO item = new MappingItemTO(); item.setIntAttrName("username"); - item.setIntMappingType(IntMappingType.Username); item.setExtAttrName("cn"); item.setPurpose(MappingPurpose.BOTH); mapping.setConnObjectKeyItem(item); item = new MappingItemTO(); item.setPassword(true); - item.setIntMappingType(IntMappingType.Password); + item.setIntAttrName("password"); item.setExtAttrName("userPassword"); item.setPurpose(MappingPurpose.BOTH); item.setMandatoryCondition("true"); mapping.add(item); item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setPurpose(MappingPurpose.BOTH); item.setExtAttrName("sn"); item.setMandatoryCondition("true"); @@ -179,7 +177,6 @@ public class MultitenancyITCase extends AbstractITCase { item = new MappingItemTO(); item.setIntAttrName("email"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setPurpose(MappingPurpose.BOTH); item.setExtAttrName("mail"); mapping.add(item); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationITCase.java index 70d55ba..012acb9 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationITCase.java @@ -30,7 +30,6 @@ import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.NotificationTO; import org.apache.syncope.common.lib.types.AnyTypeKind; import org.apache.syncope.common.lib.types.ClientExceptionType; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.TraceLevel; import org.apache.syncope.common.rest.api.service.NotificationService; import org.apache.syncope.fit.AbstractITCase; @@ -51,7 +50,6 @@ public class NotificationITCase extends AbstractITCase { is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query()); notificationTO.setRecipientAttrName("email"); - notificationTO.setRecipientAttrType(IntMappingType.UserPlainSchema); notificationTO.setSender("sync...@syncope.apache.org"); notificationTO.setSubject("Test notification"); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java index 5493282..665d38b 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java @@ -46,7 +46,6 @@ import org.apache.syncope.common.lib.to.NotificationTaskTO; import org.apache.syncope.common.lib.to.ExecTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.AnyTypeKind; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.TaskType; import org.apache.syncope.common.lib.types.TraceLevel; import org.apache.syncope.common.rest.api.beans.ExecuteQuery; @@ -322,7 +321,6 @@ public class NotificationTaskITCase extends AbstractTaskITCase { inGroups("f779c0d4-633b-4be5-8f57-32eb478a3ca5").query()); notification.setSelfAsRecipient(false); notification.setRecipientAttrName("email"); - notification.setRecipientAttrType(IntMappingType.UserPlainSchema); notification.getStaticRecipients().add(MAIL_ADDRESS); notification.setRecipientsProviderClassName(TestNotificationRecipientsProvider.class.getName()); @@ -395,7 +393,6 @@ public class NotificationTaskITCase extends AbstractTaskITCase { inGroups("f779c0d4-633b-4be5-8f57-32eb478a3ca5").query()); notification.setSelfAsRecipient(true); notification.setRecipientAttrName("email"); - notification.setRecipientAttrType(IntMappingType.UserPlainSchema); if (staticRecipients != null) { CollectionUtils.addAll(notification.getStaticRecipients(), staticRecipients); } http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java index 3f9ac6d..36fe888 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java @@ -88,7 +88,7 @@ public class PlainSchemaITCase extends AbstractITCase { boolean entityViolationTypeCheck = false; for (String element : e.getElements()) { if (!entityViolationTypeCheck) { - entityViolationTypeCheck = element.contains(EntityViolationType.InvalidName.name()); + entityViolationTypeCheck = element.contains(EntityViolationType.InvalidKey.name()); } } assertTrue(entityViolationTypeCheck); @@ -334,7 +334,7 @@ public class PlainSchemaITCase extends AbstractITCase { fail(); } catch (SyncopeClientException e) { assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType()); - assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name())); + assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidKey.name())); } } } http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java index ed9b603..243aff7 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java @@ -44,7 +44,6 @@ import org.apache.syncope.common.lib.to.ProvisionTO; import org.apache.syncope.common.lib.to.ExecTO; import org.apache.syncope.common.lib.types.AnyTypeKind; import org.apache.syncope.common.lib.types.AttrSchemaType; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.common.lib.types.MatchingRule; import org.apache.syncope.common.lib.types.PropagationTaskExecStatus; @@ -317,7 +316,6 @@ public class PushTaskITCase extends AbstractTaskITCase { provisionTO.setMapping(mapping); MappingItemTO item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.GroupPlainSchema); item.setExtAttrName("cn"); item.setIntAttrName(schemaTO.getKey()); item.setConnObjectKey(true); @@ -387,7 +385,6 @@ public class PushTaskITCase extends AbstractTaskITCase { notification.getStaticRecipients().add("issueyncope...@syncope.apache.org"); notification.setSelfAsRecipient(false); notification.setRecipientAttrName("email"); - notification.setRecipientAttrType(IntMappingType.UserPlainSchema); notification.setSender("syncope...@syncope.apache.org"); String subject = "Test notification"; http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java index ffd2a4f..f509611 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java @@ -50,7 +50,6 @@ import org.apache.syncope.common.lib.types.ClientExceptionType; import org.apache.syncope.common.lib.types.ConnConfPropSchema; import org.apache.syncope.common.lib.types.ConnConfProperty; import org.apache.syncope.common.lib.types.EntityViolationType; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.common.rest.api.beans.ConnObjectTOListQuery; import org.apache.syncope.common.rest.api.service.ResourceService; @@ -80,21 +79,18 @@ public class ResourceITCase extends AbstractITCase { MappingItemTO item = new MappingItemTO(); item.setExtAttrName("userId"); item.setIntAttrName("userId"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setPurpose(MappingPurpose.BOTH); mapping.add(item); item = new MappingItemTO(); item.setExtAttrName("username"); - item.setIntAttrName("fullname"); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setPurpose(MappingPurpose.BOTH); mapping.setConnObjectKeyItem(item); item = new MappingItemTO(); item.setExtAttrName("fullname"); item.setIntAttrName("cn"); - item.setIntMappingType(IntMappingType.UserDerivedSchema); item.setConnObjectKey(false); item.setPurpose(MappingPurpose.PROPAGATION); mapping.add(item); @@ -139,14 +135,12 @@ public class ResourceITCase extends AbstractITCase { MappingItemTO item = new MappingItemTO(); item.setExtAttrName("uid"); item.setIntAttrName("userId"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setPurpose(MappingPurpose.BOTH); mapping.add(item); item = new MappingItemTO(); item.setExtAttrName("username"); - item.setIntAttrName("fullname"); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setConnObjectKey(true); item.setPurpose(MappingPurpose.BOTH); mapping.setConnObjectKeyItem(item); @@ -154,7 +148,6 @@ public class ResourceITCase extends AbstractITCase { item = new MappingItemTO(); item.setExtAttrName("fullname"); item.setIntAttrName("cn"); - item.setIntMappingType(IntMappingType.UserDerivedSchema); item.setConnObjectKey(false); item.setPurpose(MappingPurpose.PROPAGATION); mapping.add(item); @@ -198,7 +191,7 @@ public class ResourceITCase extends AbstractITCase { provisionTO.setMapping(mapping); MappingItemTO item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setExtAttrName("userId"); item.setConnObjectKey(true); item.setPurpose(MappingPurpose.PROPAGATION); @@ -212,7 +205,7 @@ public class ResourceITCase extends AbstractITCase { mapping = new MappingTO(); provisionTO.setMapping(mapping); item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.GroupKey); + item.setIntAttrName("key"); item.setExtAttrName("groupId"); item.setConnObjectKey(true); item.setPurpose(MappingPurpose.PULL); @@ -248,13 +241,12 @@ public class ResourceITCase extends AbstractITCase { provisionTO.setMapping(mapping); MappingItemTO item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setExtAttrName("userId"); item.setConnObjectKey(true); mapping.setConnObjectKeyItem(item); item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("email"); // missing intAttrName ... mapping.add(item); @@ -286,13 +278,12 @@ public class ResourceITCase extends AbstractITCase { provisionTO.setMapping(mapping); MappingItemTO item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setExtAttrName("userId"); item.setConnObjectKey(true); mapping.setConnObjectKeyItem(item); item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setIntAttrName("usernane"); // missing extAttrName ... mapping.add(item); @@ -319,7 +310,6 @@ public class ResourceITCase extends AbstractITCase { MappingItemTO item = new MappingItemTO(); item.setExtAttrName("userId"); item.setIntAttrName("userId"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setConnObjectKey(true); item.setPurpose(MappingPurpose.BOTH); mapping.setConnObjectKeyItem(item); @@ -368,7 +358,6 @@ public class ResourceITCase extends AbstractITCase { item.setKey("cc973ed6-d031-4790-adab-fc059ac0c818"); item.setExtAttrName("test3"); item.setIntAttrName("fullname"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setPurpose(MappingPurpose.BOTH); mapping.add(item); @@ -377,14 +366,12 @@ public class ResourceITCase extends AbstractITCase { item = new MappingItemTO(); item.setExtAttrName("test" + i); item.setIntAttrName("fullname"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setPurpose(MappingPurpose.BOTH); mapping.add(item); } item = new MappingItemTO(); item.setExtAttrName("username"); - item.setIntAttrName("fullname"); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setConnObjectKey(true); item.setPurpose(MappingPurpose.BOTH); mapping.setConnObjectKeyItem(item); @@ -642,13 +629,13 @@ public class ResourceITCase extends AbstractITCase { provisionTO.setMapping(mapping); MappingItemTO item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.GroupName); + item.setIntAttrName("name"); item.setExtAttrName("cn"); item.setPurpose(MappingPurpose.BOTH); mapping.setConnObjectKeyItem(item); item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.GroupOwnerSchema); + item.setIntAttrName("owner"); item.setExtAttrName("owner"); item.setPurpose(MappingPurpose.BOTH); mapping.add(item); @@ -666,7 +653,7 @@ public class ResourceITCase extends AbstractITCase { fail(); } catch (SyncopeClientException e) { assertEquals(ClientExceptionType.InvalidExternalResource, e.getType()); - assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name())); + assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidKey.name())); } } @@ -687,14 +674,13 @@ public class ResourceITCase extends AbstractITCase { provisionTO.setMapping(mapping); MappingItemTO item = new MappingItemTO(); - item.setIntMappingType(IntMappingType.UserKey); + item.setIntAttrName("key"); item.setExtAttrName("userId"); item.setConnObjectKey(true); item.setPurpose(MappingPurpose.PROPAGATION); mapping.setConnObjectKeyItem(item); MappingItemTO item2 = new MappingItemTO(); - item2.setIntMappingType(IntMappingType.UserPlainSchema); item2.setConnObjectKey(false); item2.setIntAttrName("gender"); item2.setExtAttrName("gender"); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java index 413d80d..37fc276 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java @@ -50,7 +50,6 @@ import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.to.VirSchemaTO; import org.apache.syncope.common.lib.types.AnyTypeKind; import org.apache.syncope.common.lib.types.ConnConfProperty; -import org.apache.syncope.common.lib.types.IntMappingType; import org.apache.syncope.common.lib.types.MappingPurpose; import org.apache.syncope.common.lib.types.PatchOperation; import org.apache.syncope.common.lib.types.PropagationTaskExecStatus; @@ -506,7 +505,6 @@ public class VirAttrITCase extends AbstractITCase { MappingItemTO item = new MappingItemTO(); item.setIntAttrName("fullname"); - item.setIntMappingType(IntMappingType.UserPlainSchema); item.setExtAttrName("ID"); item.setPurpose(MappingPurpose.PROPAGATION); item.setConnObjectKey(true); @@ -515,14 +513,12 @@ public class VirAttrITCase extends AbstractITCase { item = new MappingItemTO(); item.setExtAttrName("USERNAME"); item.setIntAttrName("username"); - item.setIntMappingType(IntMappingType.Username); item.setPurpose(MappingPurpose.PROPAGATION); mapping.getItems().add(item); item = new MappingItemTO(); item.setExtAttrName("EMAIL"); item.setIntAttrName("rvirtualdata"); - item.setIntMappingType(IntMappingType.GroupVirtualSchema); item.setPurpose(MappingPurpose.PROPAGATION); mapping.getItems().add(item); http://git-wip-us.apache.org/repos/asf/syncope/blob/d348aeb9/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirSchemaITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirSchemaITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirSchemaITCase.java index fbe264e..b7ab0ce 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirSchemaITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirSchemaITCase.java @@ -148,7 +148,7 @@ public class VirSchemaITCase extends AbstractITCase { } catch (SyncopeClientException e) { assertEquals(ClientExceptionType.InvalidVirSchema, e.getType()); - assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name())); + assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidKey.name())); } } }