You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2014/06/19 15:04:41 UTC
svn commit: r1603867 [3/3] - in /syncope/trunk:
client/src/main/java/org/apache/syncope/client/
common/src/main/java/org/apache/syncope/common/mod/
common/src/main/java/org/apache/syncope/common/search/
common/src/main/java/org/apache/syncope/common/se...
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/RoleTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/RoleTestITCase.java?rev=1603867&r1=1603866&r2=1603867&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/RoleTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/RoleTestITCase.java Thu Jun 19 13:04:39 2014
@@ -34,29 +34,30 @@ import javax.ws.rs.core.Response;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.SyncopeClient;
+import org.apache.syncope.common.SyncopeClientException;
+import org.apache.syncope.common.mod.AttributeMod;
import org.apache.syncope.common.mod.RoleMod;
+import org.apache.syncope.common.reqres.BulkActionResult;
+import org.apache.syncope.common.reqres.PagedResult;
import org.apache.syncope.common.services.RoleService;
import org.apache.syncope.common.to.ConnObjectTO;
-import org.apache.syncope.common.reqres.PagedResult;
-import org.apache.syncope.common.wrap.ResourceName;
+import org.apache.syncope.common.to.MappingItemTO;
+import org.apache.syncope.common.to.MappingTO;
+import org.apache.syncope.common.to.ResourceTO;
import org.apache.syncope.common.to.RoleTO;
import org.apache.syncope.common.to.SchemaTO;
import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.ClientExceptionType;
+import org.apache.syncope.common.types.MappingPurpose;
import org.apache.syncope.common.types.Preference;
import org.apache.syncope.common.types.RESTHeaders;
-import org.apache.syncope.common.types.SchemaType;
-import org.apache.syncope.common.util.CollectionWrapper;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.common.mod.AttributeMod;
-import org.apache.syncope.common.reqres.BulkActionResult;
-import org.apache.syncope.common.to.MappingItemTO;
-import org.apache.syncope.common.to.MappingTO;
-import org.apache.syncope.common.to.ResourceTO;
-import org.apache.syncope.common.types.MappingPurpose;
import org.apache.syncope.common.types.ResourceAssociationActionType;
import org.apache.syncope.common.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.types.SchemaType;
+import org.apache.syncope.common.types.SubjectType;
+import org.apache.syncope.common.util.CollectionWrapper;
+import org.apache.syncope.common.wrap.ResourceName;
import org.identityconnectors.framework.common.objects.Name;
import org.junit.FixMethodOrder;
import org.junit.Test;
@@ -128,7 +129,7 @@ public class RoleTestITCase extends Abst
assertTrue(roleTO.getResources().contains(RESOURCE_NAME_LDAP));
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, roleTO.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getId());
assertNotNull(connObjectTO);
assertNotNull(connObjectTO.getAttrMap().get("owner"));
}
@@ -408,7 +409,7 @@ public class RoleTestITCase extends Abst
RoleTO actual = createRole(buildRoleTO("unlink"));
assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId()));
assertNotNull(roleService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.UNLINK,
@@ -419,7 +420,7 @@ public class RoleTestITCase extends Abst
assertNotNull(actual);
assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId()));
}
@Test
@@ -431,7 +432,7 @@ public class RoleTestITCase extends Abst
assertNotNull(actual);
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -446,7 +447,7 @@ public class RoleTestITCase extends Abst
assertFalse(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -458,7 +459,7 @@ public class RoleTestITCase extends Abst
RoleTO actual = createRole(buildRoleTO("unassign"));
assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId()));
assertNotNull(roleService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.UNASSIGN,
@@ -470,7 +471,7 @@ public class RoleTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -486,7 +487,7 @@ public class RoleTestITCase extends Abst
assertNotNull(actual);
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -499,7 +500,7 @@ public class RoleTestITCase extends Abst
actual = roleService.read(actual.getId());
assertFalse(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId()));
}
@Test
@@ -507,7 +508,7 @@ public class RoleTestITCase extends Abst
RoleTO actual = createRole(buildRoleTO("deprovision"));
assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId()));
assertNotNull(roleService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.DEPROVISION,
@@ -519,7 +520,7 @@ public class RoleTestITCase extends Abst
assertFalse(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -535,7 +536,7 @@ public class RoleTestITCase extends Abst
assertNotNull(actual);
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -549,7 +550,7 @@ public class RoleTestITCase extends Abst
actual = roleService.read(actual.getId());
assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId()));
}
@Test
@@ -561,7 +562,7 @@ public class RoleTestITCase extends Abst
assertNotNull(actual);
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -575,7 +576,7 @@ public class RoleTestITCase extends Abst
actual = roleService.read(actual.getId());
assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId()));
assertNotNull(roleService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.DEPROVISION,
@@ -587,7 +588,7 @@ public class RoleTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -687,7 +688,7 @@ public class RoleTestITCase extends Abst
assertTrue(parent.getResources().contains(RESOURCE_NAME_LDAP));
final ConnObjectTO parentRemoteObject =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, parent.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, parent.getId());
assertNotNull(parentRemoteObject);
assertNotNull(getLdapRemoteObject(parentRemoteObject.getAttrMap().get(Name.NAME).getValues().get(0)));
@@ -700,7 +701,7 @@ public class RoleTestITCase extends Abst
assertTrue(child.getResources().contains(RESOURCE_NAME_LDAP));
final ConnObjectTO childRemoteObject =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, child.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, child.getId());
assertNotNull(childRemoteObject);
assertNotNull(getLdapRemoteObject(childRemoteObject.getAttrMap().get(Name.NAME).getValues().get(0)));
@@ -737,7 +738,7 @@ public class RoleTestITCase extends Abst
roleTO = createRole(roleTO);
assertTrue(roleTO.getResources().contains(RESOURCE_NAME_LDAP));
- ConnObjectTO actual = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE,
+ ConnObjectTO actual = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE,
roleTO.getId());
assertNotNull(actual);
@@ -784,7 +785,7 @@ public class RoleTestITCase extends Abst
// check update on Syncope
assertEquals("TITLENEW", roleTO.getAttrMap().get("title").getValues().get(0));
- final ConnObjectTO newRole = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE,
+ final ConnObjectTO newRole = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE,
roleTO.getId());
// due to NONE mapping for attribute title external attribute description must not be present
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java?rev=1603867&r1=1603866&r2=1603867&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java Thu Jun 19 13:04:39 2014
@@ -33,6 +33,7 @@ import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.helpers.IOUtils;
import org.apache.syncope.client.SyncopeClient;
+import org.apache.syncope.common.SyncopeClientException;
import org.apache.syncope.common.mod.AttributeMod;
import org.apache.syncope.common.mod.MembershipMod;
import org.apache.syncope.common.mod.StatusMod;
@@ -43,11 +44,10 @@ import org.apache.syncope.common.to.Memb
import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.common.to.WorkflowFormPropertyTO;
import org.apache.syncope.common.to.WorkflowFormTO;
-import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.ClientExceptionType;
import org.apache.syncope.common.types.Preference;
import org.apache.syncope.common.types.RESTHeaders;
-import org.apache.syncope.common.SyncopeClientException;
+import org.apache.syncope.common.types.SubjectType;
import org.apache.syncope.core.workflow.ActivitiDetector;
import org.junit.Assume;
import org.junit.FixMethodOrder;
@@ -104,7 +104,7 @@ public class UserSelfTestITCase extends
assertFalse(userTO.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, userTO.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getId());
fail();
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -119,7 +119,7 @@ public class UserSelfTestITCase extends
userTO = userWorkflowService.submitForm(form);
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, userTO.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getId()));
}
@Test
@@ -195,7 +195,7 @@ public class UserSelfTestITCase extends
// no propagation happened
assertTrue(updated.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, updated.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getId());
fail();
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -215,7 +215,7 @@ public class UserSelfTestITCase extends
// check that propagation also happened
assertTrue(updated.getResources().contains(RESOURCE_NAME_TESTDB));
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, updated.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getId()));
}
@Test
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java?rev=1603867&r1=1603866&r2=1603867&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java Thu Jun 19 13:04:39 2014
@@ -26,69 +26,66 @@ import static org.junit.Assert.assertNul
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import java.io.IOException;
+import java.io.InputStream;
import java.security.AccessControlException;
import java.text.SimpleDateFormat;
+import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
-
+import javax.naming.NamingException;
+import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.Response;
-
+import javax.xml.ws.WebServiceException;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.cxf.common.util.Base64Utility;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.syncope.client.SyncopeClient;
+import org.apache.syncope.common.SyncopeClientException;
import org.apache.syncope.common.mod.AttributeMod;
import org.apache.syncope.common.mod.MembershipMod;
+import org.apache.syncope.common.mod.ResourceAssociationMod;
import org.apache.syncope.common.mod.StatusMod;
import org.apache.syncope.common.mod.UserMod;
+import org.apache.syncope.common.reqres.BulkAction;
+import org.apache.syncope.common.reqres.BulkActionResult;
+import org.apache.syncope.common.reqres.BulkActionResult.Status;
+import org.apache.syncope.common.reqres.PagedResult;
import org.apache.syncope.common.services.PolicyService;
import org.apache.syncope.common.services.ResourceService;
import org.apache.syncope.common.services.UserSelfService;
+import org.apache.syncope.common.services.UserService;
import org.apache.syncope.common.to.AttributeTO;
-import org.apache.syncope.common.reqres.BulkAction;
-import org.apache.syncope.common.reqres.BulkActionResult;
-import org.apache.syncope.common.reqres.BulkActionResult.Status;
import org.apache.syncope.common.to.ConfigurationTO;
import org.apache.syncope.common.to.ConnObjectTO;
import org.apache.syncope.common.to.MappingItemTO;
+import org.apache.syncope.common.to.MappingTO;
import org.apache.syncope.common.to.MembershipTO;
import org.apache.syncope.common.to.PasswordPolicyTO;
import org.apache.syncope.common.to.PropagationStatus;
import org.apache.syncope.common.to.PropagationTaskTO;
-import org.apache.syncope.common.wrap.ResourceName;
import org.apache.syncope.common.to.ResourceTO;
import org.apache.syncope.common.to.RoleTO;
import org.apache.syncope.common.to.UserTO;
-import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.CipherAlgorithm;
+import org.apache.syncope.common.types.ClientExceptionType;
+import org.apache.syncope.common.types.MappingPurpose;
import org.apache.syncope.common.types.PolicyType;
+import org.apache.syncope.common.types.Preference;
import org.apache.syncope.common.types.PropagationTaskExecStatus;
-import org.apache.syncope.common.types.ClientExceptionType;
+import org.apache.syncope.common.types.RESTHeaders;
+import org.apache.syncope.common.types.ResourceAssociationActionType;
+import org.apache.syncope.common.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.types.SubjectType;
import org.apache.syncope.common.types.TaskType;
import org.apache.syncope.common.util.AttributableOperations;
import org.apache.syncope.common.util.CollectionWrapper;
-import org.apache.syncope.common.SyncopeClientException;
+import org.apache.syncope.common.wrap.ResourceName;
import org.apache.syncope.core.persistence.beans.user.SyncopeUser;
import org.apache.syncope.core.workflow.ActivitiDetector;
-import org.identityconnectors.framework.common.objects.OperationalAttributes;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import javax.naming.NamingException;
-import javax.ws.rs.core.EntityTag;
-import javax.xml.ws.WebServiceException;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.cxf.common.util.Base64Utility;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.syncope.client.SyncopeClient;
-import org.apache.syncope.common.mod.ResourceAssociationMod;
-import org.apache.syncope.common.services.UserService;
-import org.apache.syncope.common.reqres.PagedResult;
-import org.apache.syncope.common.to.MappingTO;
-import org.apache.syncope.common.types.MappingPurpose;
-import org.apache.syncope.common.types.Preference;
-import org.apache.syncope.common.types.RESTHeaders;
-import org.apache.syncope.common.types.ResourceAssociationActionType;
-import org.apache.syncope.common.types.ResourceDeassociationActionType;
import org.identityconnectors.framework.common.objects.Name;
+import org.identityconnectors.framework.common.objects.OperationalAttributes;
import org.junit.Assume;
import org.junit.FixMethodOrder;
import org.junit.Test;
@@ -923,10 +920,10 @@ public class UserTestITCase extends Abst
assertEquals("suspended", userTO.getStatus());
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, userId);
+ resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.USER, userId);
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userId);
assertNotNull(connObjectTO);
// Suspend and reactivate only on ldap => db and syncope should still show suspended
@@ -940,7 +937,7 @@ public class UserTestITCase extends Abst
assertNotNull(userTO);
assertEquals("suspended", userTO.getStatus());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, userId);
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
// Reactivate on syncope and db => syncope and db should show the user as active
@@ -953,7 +950,7 @@ public class UserTestITCase extends Abst
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, userId);
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
assertTrue(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
}
@@ -1152,7 +1149,7 @@ public class UserTestITCase extends Abst
assertNotNull(actual.getDerAttrMap().get("csvuserid"));
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
assertNotNull(connObjectTO);
assertEquals("sx-dx", connObjectTO.getAttrMap().get("ROLE").getValues().get(0));
}
@@ -1180,7 +1177,7 @@ public class UserTestITCase extends Abst
assertNotNull(actual.getDerAttrMap().get("csvuserid"));
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
assertNotNull(connObjectTO);
assertEquals("sx-dx", connObjectTO.getAttrMap().get("MEMBERSHIP").getValues().get(0));
}
@@ -1241,7 +1238,7 @@ public class UserTestITCase extends Abst
assertEquals(1, actual.getResources().size());
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
assertNotNull(connObjectTO);
// -----------------------------------
@@ -1256,7 +1253,7 @@ public class UserTestITCase extends Abst
assertNotNull(actual);
assertEquals(1, actual.getMemberships().size());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
assertNotNull(connObjectTO);
// -----------------------------------
@@ -1273,7 +1270,7 @@ public class UserTestITCase extends Abst
assertEquals(1, actual.getMemberships().size());
assertFalse(actual.getResources().isEmpty());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
assertNotNull(connObjectTO);
// -----------------------------------
@@ -1291,7 +1288,7 @@ public class UserTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail("Read should not succeeed");
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -1323,7 +1320,7 @@ public class UserTestITCase extends Abst
assertEquals(2, actual.getMemberships().size());
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getId());
assertNotNull(connObjectTO);
AttributeTO postalAddress = connObjectTO.getAttrMap().get("postalAddress");
@@ -1352,7 +1349,7 @@ public class UserTestITCase extends Abst
assertNotNull(actual);
assertEquals(1, actual.getMemberships().size());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.USER, actual.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getId());
assertNotNull(connObjectTO);
postalAddress = connObjectTO.getAttrMap().get("postalAddress");
@@ -1384,7 +1381,7 @@ public class UserTestITCase extends Abst
// 3. try (and fail) to find this user on the external LDAP resource
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.USER, userTO.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getId());
fail("This entry should not be present on this resource");
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -1437,7 +1434,7 @@ public class UserTestITCase extends Abst
assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_DBVIRATTR, AttributableType.USER, userTO.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_DBVIRATTR, SubjectType.USER, userTO.getId());
assertNotNull(connObjectTO);
assertEquals("virtualvalue", connObjectTO.getAttrMap().get("USERNAME").getValues().get(0));
// ----------------------------------
@@ -1495,7 +1492,7 @@ public class UserTestITCase extends Abst
final String pwdOnSyncope = userTO.getPassword();
ConnObjectTO userOnDb = resourceService.getConnectorObject(
- RESOURCE_NAME_TESTDB, AttributableType.USER, userTO.getId());
+ RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getId());
final AttributeTO pwdOnTestDbAttr = userOnDb.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
assertNotNull(pwdOnTestDbAttr);
assertNotNull(pwdOnTestDbAttr.getValues());
@@ -1503,7 +1500,7 @@ public class UserTestITCase extends Abst
final String pwdOnTestDb = pwdOnTestDbAttr.getValues().iterator().next();
ConnObjectTO userOnDb2 = resourceService.getConnectorObject(
- RESOURCE_NAME_TESTDB2, AttributableType.USER, userTO.getId());
+ RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getId());
final AttributeTO pwdOnTestDb2Attr = userOnDb2.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
assertNotNull(pwdOnTestDb2Attr);
assertNotNull(pwdOnTestDb2Attr.getValues());
@@ -1530,7 +1527,7 @@ public class UserTestITCase extends Abst
assertEquals(pwdOnSyncope, userTO.getPassword());
// 3c. verify that password *has* changed on testdb
- userOnDb = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, AttributableType.USER, userTO.getId());
+ userOnDb = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getId());
final AttributeTO pwdOnTestDbAttrAfter = userOnDb.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
assertNotNull(pwdOnTestDbAttrAfter);
assertNotNull(pwdOnTestDbAttrAfter.getValues());
@@ -1538,7 +1535,7 @@ public class UserTestITCase extends Abst
assertNotEquals(pwdOnTestDb, pwdOnTestDbAttrAfter.getValues().iterator().next());
// 3d. verify that password hasn't changed on testdb2
- userOnDb2 = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB2, AttributableType.USER, userTO.getId());
+ userOnDb2 = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getId());
final AttributeTO pwdOnTestDb2AttrAfter = userOnDb2.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
assertNotNull(pwdOnTestDb2AttrAfter);
assertNotNull(pwdOnTestDb2AttrAfter.getValues());
@@ -1627,7 +1624,7 @@ public class UserTestITCase extends Abst
assertNotNull(actual);
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
assertNull(connObjectTO.getAttrMap().get("email"));
}
@@ -1715,7 +1712,7 @@ public class UserTestITCase extends Abst
// 3. read role on resource, check that user DN is included in uniqueMember
ConnObjectTO connObj = resourceService.getConnectorObject(
- RESOURCE_NAME_LDAP, AttributableType.ROLE, roleTO.getId());
+ RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getId());
assertNotNull(connObj);
assertTrue(connObj.getAttrMap().get("uniqueMember").getValues().
contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
@@ -1729,7 +1726,7 @@ public class UserTestITCase extends Abst
assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
// 5. read role on resource, check that user DN was removed from uniqueMember
- connObj = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.ROLE, roleTO.getId());
+ connObj = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getId());
assertNotNull(connObj);
assertFalse(connObj.getAttrMap().get("uniqueMember").getValues().
contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
@@ -1770,7 +1767,7 @@ public class UserTestITCase extends Abst
// 3. read user on resource
ConnObjectTO connObj = resourceService.getConnectorObject(
- RESOURCE_NAME_LDAP, AttributableType.USER, userTO.getId());
+ RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getId());
assertNotNull(connObj);
AttributeTO registeredAddress = connObj.getAttrMap().get("registeredAddress");
assertNotNull(registeredAddress);
@@ -1784,7 +1781,7 @@ public class UserTestITCase extends Abst
// 5. try to read user on resource: fail
try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.USER, userTO.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getId());
fail();
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -1875,7 +1872,7 @@ public class UserTestITCase extends Abst
UserTO actual = createUser(userTO);
assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId()));
assertNotNull(userService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.UNLINK,
@@ -1886,7 +1883,7 @@ public class UserTestITCase extends Abst
assertNotNull(actual);
assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId()));
}
@Test
@@ -1903,7 +1900,7 @@ public class UserTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -1920,7 +1917,7 @@ public class UserTestITCase extends Abst
assertFalse(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -1939,7 +1936,7 @@ public class UserTestITCase extends Abst
UserTO actual = createUser(userTO);
assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId()));
assertNotNull(userService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.UNASSIGN,
@@ -1951,7 +1948,7 @@ public class UserTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -1972,7 +1969,7 @@ public class UserTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -1989,7 +1986,7 @@ public class UserTestITCase extends Abst
actual = userService.read(actual.getId());
assertNotNull(actual);
assertFalse(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId()));
}
@Test
@@ -2004,7 +2001,7 @@ public class UserTestITCase extends Abst
UserTO actual = createUser(userTO);
assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId()));
assertNotNull(userService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.DEPROVISION,
@@ -2016,7 +2013,7 @@ public class UserTestITCase extends Abst
assertFalse(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -2037,7 +2034,7 @@ public class UserTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -2055,7 +2052,7 @@ public class UserTestITCase extends Abst
actual = userService.read(actual.getId());
assertNotNull(actual);
assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId()));
}
@Test
@@ -2072,7 +2069,7 @@ public class UserTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -2090,7 +2087,7 @@ public class UserTestITCase extends Abst
actual = userService.read(actual.getId());
assertNotNull(actual);
assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId()));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId()));
assertNotNull(userService.bulkDeassociation(actual.getId(),
ResourceDeassociationActionType.DEPROVISION,
@@ -2102,7 +2099,7 @@ public class UserTestITCase extends Abst
assertTrue(actual.getResources().isEmpty());
try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, AttributableType.USER, actual.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getId());
fail();
} catch (Exception e) {
assertNotNull(e);
@@ -2207,7 +2204,7 @@ public class UserTestITCase extends Abst
// 2. read resource configuration for LDAP binding
ConnObjectTO connObject =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, AttributableType.USER, userTO.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getId());
// 3. try (and succeed) to perform simple LDAP binding with provided password ('password123')
assertNotNull(getLdapRemoteObject(
@@ -2240,7 +2237,7 @@ public class UserTestITCase extends Abst
assertEquals(1, userTO.getPropagationStatusTOs().size());
assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- final ConnObjectTO actual = resourceService.getConnectorObject(RESOURCE_NAME_WS1, AttributableType.USER, userTO.
+ final ConnObjectTO actual = resourceService.getConnectorObject(RESOURCE_NAME_WS1, SubjectType.USER, userTO.
getId());
assertNotNull(actual);
// check if mapping attribute with purpose NONE really hasn't been propagated
@@ -2281,7 +2278,7 @@ public class UserTestITCase extends Abst
assertEquals(1, userTO.getPropagationStatusTOs().size());
assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- final ConnObjectTO newUser = resourceService.getConnectorObject(RESOURCE_NAME_WS1, AttributableType.USER,
+ final ConnObjectTO newUser = resourceService.getConnectorObject(RESOURCE_NAME_WS1, SubjectType.USER,
userTO.getId());
assertNotNull(newUser.getAttrMap().get("NAME"));
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirAttrTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirAttrTestITCase.java?rev=1603867&r1=1603866&r2=1603867&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirAttrTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirAttrTestITCase.java Thu Jun 19 13:04:39 2014
@@ -25,8 +25,8 @@ import static org.junit.Assert.assertNot
import static org.junit.Assert.assertTrue;
import java.util.Collections;
-import org.apache.commons.lang3.SerializationUtils;
import java.util.Map;
+import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.mod.AttributeMod;
import org.apache.syncope.common.mod.MembershipMod;
@@ -42,11 +42,11 @@ import org.apache.syncope.common.to.Memb
import org.apache.syncope.common.to.ResourceTO;
import org.apache.syncope.common.to.RoleTO;
import org.apache.syncope.common.to.UserTO;
-import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.ConnConfProperty;
import org.apache.syncope.common.types.IntMappingType;
import org.apache.syncope.common.types.MappingPurpose;
import org.apache.syncope.common.types.PropagationTaskExecStatus;
+import org.apache.syncope.common.types.SubjectType;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
@@ -102,7 +102,7 @@ public class VirAttrTestITCase extends A
assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_WS2, AttributableType.USER, userTO.getId());
+ resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getId());
assertNotNull(connObjectTO);
assertEquals("virtualvalue", connObjectTO.getAttrMap().get("NAME").getValues().get(0));
// ----------------------------------
@@ -126,7 +126,7 @@ public class VirAttrTestITCase extends A
assertEquals("ws-target-resource-2", userTO.getPropagationStatusTOs().get(0).getResource());
assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, AttributableType.USER, userTO.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getId());
assertNotNull(connObjectTO);
assertEquals("virtualvalue2", connObjectTO.getAttrMap().get("NAME").getValues().get(0));
// ----------------------------------
@@ -139,7 +139,7 @@ public class VirAttrTestITCase extends A
userTO = userService.status(userTO.getId(), statusMod).readEntity(UserTO.class);
assertEquals("suspended", userTO.getStatus());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, AttributableType.USER, userTO.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getId());
assertNotNull(connObjectTO);
assertFalse(connObjectTO.getAttrMap().get("NAME").getValues().isEmpty());
assertEquals("virtualvalue2", connObjectTO.getAttrMap().get("NAME").getValues().get(0));
@@ -149,7 +149,7 @@ public class VirAttrTestITCase extends A
userTO = userService.status(userTO.getId(), statusMod).readEntity(UserTO.class);
assertEquals("active", userTO.getStatus());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, AttributableType.USER, userTO.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getId());
assertNotNull(connObjectTO);
assertFalse(connObjectTO.getAttrMap().get("NAME").getValues().isEmpty());
assertEquals("virtualvalue2", connObjectTO.getAttrMap().get("NAME").getValues().get(0));
@@ -174,7 +174,7 @@ public class VirAttrTestITCase extends A
assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, AttributableType.USER, userTO.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getId());
assertNotNull(connObjectTO);
assertEquals("Surname2", connObjectTO.getAttrMap().get("SURNAME").getValues().get(0));
@@ -197,7 +197,7 @@ public class VirAttrTestITCase extends A
assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, AttributableType.USER, userTO.getId());
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getId());
assertNotNull(connObjectTO);
// attribute "name" mapped on virtual attribute "virtualdata" should be reset
@@ -771,7 +771,6 @@ public class VirAttrTestITCase extends A
get(0));
// ----------------------------------------------------------
-
// PHASE 2: update only membership virtual attributes
// -------------------------------------------
// Update resource-db-virattr mapping adding new membership virtual schema mapping
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java?rev=1603867&r1=1603866&r2=1603867&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java Thu Jun 19 13:04:39 2014
@@ -27,7 +27,7 @@ import java.io.IOException;
import java.io.InputStream;
import javax.ws.rs.core.Response;
import org.apache.commons.io.IOUtils;
-import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.SubjectType;
import org.apache.syncope.core.workflow.ActivitiDetector;
import org.junit.Assume;
import org.junit.Test;
@@ -37,14 +37,12 @@ public class WorkflowTestITCase extends
@Test
public void isActivitiEnabled() {
assertEquals(ActivitiDetector.isActivitiEnabledForUsers(),
- adminClient.isActivitiEnabledFor(AttributableType.USER));
+ adminClient.isActivitiEnabledFor(SubjectType.USER));
assertEquals(ActivitiDetector.isActivitiEnabledForRoles(),
- adminClient.isActivitiEnabledFor(AttributableType.ROLE));
- assertEquals(false,
- adminClient.isActivitiEnabledFor(AttributableType.MEMBERSHIP));
+ adminClient.isActivitiEnabledFor(SubjectType.ROLE));
}
- private void exportDefinition(final AttributableType type) throws IOException {
+ private void exportDefinition(final SubjectType type) throws IOException {
Response response = workflowService.exportDefinition(type);
assertTrue(response.getMediaType().toString().
startsWith(clientFactory.getContentType().getMediaType().toString()));
@@ -57,16 +55,16 @@ public class WorkflowTestITCase extends
@Test
public void exportUserDefinition() throws IOException {
Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
- exportDefinition(AttributableType.USER);
+ exportDefinition(SubjectType.USER);
}
@Test
public void getRoleDefinition() throws IOException {
Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles());
- exportDefinition(AttributableType.ROLE);
+ exportDefinition(SubjectType.ROLE);
}
- private void importDefinition(final AttributableType type) throws IOException {
+ private void importDefinition(final SubjectType type) throws IOException {
Response response = workflowService.exportDefinition(type);
String definition = IOUtils.toString((InputStream) response.getEntity());
@@ -77,13 +75,13 @@ public class WorkflowTestITCase extends
public void updateUserDefinition() throws IOException {
Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
- importDefinition(AttributableType.USER);
+ importDefinition(SubjectType.USER);
}
@Test
public void updateRoleDefinition() throws IOException {
Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles());
- importDefinition(AttributableType.ROLE);
+ importDefinition(SubjectType.ROLE);
}
}