syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [62/70] syncope git commit: Improving REST update methods signature thanks to CXF-6447
Date Thu, 11 Jun 2015 14:17:52 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
index 2616d4a..60842b9 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
@@ -172,8 +172,8 @@ public class ConnectorITCase extends AbstractITCase {
         assertEquals(Integer.valueOf(15), actual.getConnRequestTimeout());
         assertEquals(connectorTO.getCapabilities(), actual.getCapabilities());
         assertNotNull(actual.getPoolConf());
-        assertEquals(1534, actual.getPoolConf().getMaxObjects().intValue());
-        assertEquals(10, actual.getPoolConf().getMaxIdle().intValue());
+        assertEquals(1534, actual.getPoolConf().getMaxObjects(), 0);
+        assertEquals(10, actual.getPoolConf().getMaxIdle(), 0);
 
         Throwable t = null;
 
@@ -182,7 +182,7 @@ public class ConnectorITCase extends AbstractITCase {
         actual.getPoolConf().setMaxObjects(null);
 
         try {
-            connectorService.update(actual.getKey(), actual);
+            connectorService.update(actual);
             actual = connectorService.read(actual.getKey());
         } catch (SyncopeClientException e) {
             LOG.error("update failed", e);
@@ -255,7 +255,7 @@ public class ConnectorITCase extends AbstractITCase {
         // set connector configuration
         connectorTO.getConfiguration().addAll(conf);
 
-        connectorService.update(connectorTO.getKey(), connectorTO);
+        connectorService.update(connectorTO);
         ConnInstanceTO actual = connectorService.read(connectorTO.getKey());
 
         assertNotNull(actual);
@@ -348,7 +348,7 @@ public class ConnectorITCase extends AbstractITCase {
         // ----------------------------------
         connInstanceTO.getCapabilities().add(ConnectorCapability.AUTHENTICATE);
 
-        connectorService.update(connInstanceTO.getKey(), connInstanceTO);
+        connectorService.update(connInstanceTO);
         ConnInstanceTO actual = connectorService.read(connInstanceTO.getKey());
         assertNotNull(actual);
         assertTrue(connInstanceTO.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
@@ -732,7 +732,7 @@ public class ConnectorITCase extends AbstractITCase {
         assertTrue(connectorInstanceTO.getCapabilities().isEmpty());
 
         connectorInstanceTO.getCapabilities().add(ConnectorCapability.SEARCH);
-        connectorService.update(connectorInstanceTO.getKey(), connectorInstanceTO);
+        connectorService.update(connectorInstanceTO);
 
         ConnInstanceTO updatedCapabilities = connectorService.read(connectorInstanceTO.getKey());
         assertNotNull(updatedCapabilities.getCapabilities());

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DerSchemaITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DerSchemaITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DerSchemaITCase.java
index d06ca77..210b515 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DerSchemaITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DerSchemaITCase.java
@@ -94,8 +94,7 @@ public class DerSchemaITCase extends AbstractITCase {
         try {
             schema.setExpression("mderived_sx + '.' + mderived_dx");
 
-            schemaService.update(SchemaType.DERIVED,
-                    schema.getKey(), schema);
+            schemaService.update(SchemaType.DERIVED, schema);
 
             schema = schemaService.read(SchemaType.DERIVED, "mderiveddata");
             assertNotNull(schema);
@@ -103,8 +102,7 @@ public class DerSchemaITCase extends AbstractITCase {
         } finally {
             // Set updated back to make test re-runnable
             schema.setExpression("mderived_sx + '-' + mderived_dx");
-            schemaService.update(SchemaType.DERIVED,
-                    schema.getKey(), schema);
+            schemaService.update(SchemaType.DERIVED, schema);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/GroupITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/GroupITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/GroupITCase.java
index f16ee21..855f25b 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/GroupITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/GroupITCase.java
@@ -272,7 +272,7 @@ public class GroupITCase extends AbstractITCase {
         GroupService groupService2 = clientFactory.create("verdi", ADMIN_PWD).getService(GroupService.class);
 
         try {
-            groupService2.update(groupMod.getKey(), groupMod);
+            groupService2.update(groupMod);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(Response.Status.UNAUTHORIZED, e.getType().getResponseStatus());
@@ -283,7 +283,7 @@ public class GroupITCase extends AbstractITCase {
         // 4. update as puccini, owner of group 6 - success
         GroupService groupService3 = clientFactory.create("puccini", ADMIN_PWD).getService(GroupService.class);
 
-        groupTO = groupService3.update(groupMod.getKey(), groupMod).readEntity(GroupTO.class);
+        groupTO = groupService3.update(groupMod).readEntity(GroupTO.class);
         assertEquals("Director", groupTO.getName());
 
         // issue SYNCOPE-15
@@ -531,7 +531,7 @@ public class GroupITCase extends AbstractITCase {
         String typeClassName = type.getClasses().get(0);
         AnyTypeClassTO typeClass = anyTypeClassService.read(typeClassName);
         typeClass.getPlainSchemas().add(badge.getKey());
-        anyTypeClassService.update(typeClassName, typeClass);
+        anyTypeClassService.update(typeClass);
         typeClass = anyTypeClassService.read(typeClassName);
         assertTrue(typeClass.getPlainSchemas().contains(badge.getKey()));
 
@@ -556,7 +556,7 @@ public class GroupITCase extends AbstractITCase {
         } finally {
             // restore the original group class
             typeClass.getPlainSchemas().remove(badge.getKey());
-            anyTypeClassService.update(typeClassName, typeClass);
+            anyTypeClassService.update(typeClass);
             typeClass = anyTypeClassService.read(typeClassName);
             assertFalse(typeClass.getPlainSchemas().contains(badge.getKey()));
         }
@@ -595,9 +595,10 @@ public class GroupITCase extends AbstractITCase {
         assertNotNull(group);
 
         GroupMod groupMod = new GroupMod();
+        groupMod.setKey(group.getKey());
         groupMod.getPlainAttrsToUpdate().add(attrMod("badge", "xxxxxxxxxx"));
 
-        response = noContentService.update(group.getKey(), groupMod);
+        response = noContentService.update(groupMod);
         assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
         assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
         assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
@@ -705,7 +706,7 @@ public class GroupITCase extends AbstractITCase {
         GroupMod mod = new GroupMod();
         mod.setKey(group.getKey());
         mod.setUDynMembershipCond("cool==false");
-        groupService.update(mod.getKey(), mod);
+        groupService.update(mod);
 
         assertTrue(userService.read(4L).getDynGroups().isEmpty());
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
index c58b7b7..09f40f9 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
@@ -93,7 +93,7 @@ public class NotificationITCase extends AbstractITCase {
         NotificationTO notificationTO = notificationService.read(10L);
         notificationTO.setRecipients(SyncopeClient.getUserSearchConditionBuilder().inGroups(7L).query());
 
-        notificationService.update(notificationTO.getKey(), notificationTO);
+        notificationService.update(notificationTO);
         NotificationTO actual = notificationService.read(notificationTO.getKey());
         assertNotNull(actual);
         assertEquals(actual, notificationTO);

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
index e6e450c..feb041a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
@@ -184,13 +184,13 @@ public class PlainSchemaITCase extends AbstractITCase {
         PlainSchemaTO schemaTO = schemaService.read(SchemaType.PLAIN, "icon");
         assertNotNull(schemaTO);
 
-        schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+        schemaService.update(SchemaType.PLAIN, schemaTO);
         PlainSchemaTO updatedTO = schemaService.read(SchemaType.PLAIN, "icon");
         assertEquals(schemaTO, updatedTO);
 
         updatedTO.setType(AttrSchemaType.Date);
         try {
-            schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), updatedTO);
+            schemaService.update(SchemaType.PLAIN, updatedTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -220,7 +220,7 @@ public class PlainSchemaITCase extends AbstractITCase {
 
         schemaTO.setType(AttrSchemaType.Long);
         try {
-            schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+            schemaService.update(SchemaType.PLAIN, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -253,7 +253,7 @@ public class PlainSchemaITCase extends AbstractITCase {
 
         UserMod userMod = AnyOperations.diff(newUserTO, userTO);
 
-        userTO = userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
+        userTO = userService.update(userMod).readEntity(UserTO.class);
         assertNotNull(userTO);
     }
 
@@ -278,7 +278,7 @@ public class PlainSchemaITCase extends AbstractITCase {
 
         schemaTO.setUniqueConstraint(false);
         try {
-            schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+            schemaService.update(SchemaType.PLAIN, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
index df36ac4..3684f35 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
@@ -141,7 +141,7 @@ public class PolicyITCase extends AbstractITCase {
         policy.setSpecification(policySpec);
 
         // update new password policy
-        policyService.update(policy.getKey(), policy);
+        policyService.update(policy);
         policy = policyService.read(policy.getKey());
 
         assertNotNull(policy);

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
index edb2366..fe2c0a5 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
@@ -91,7 +91,7 @@ public class RealmITCase extends AbstractITCase {
         // 2. update setting policies
         actual.setAccountPolicy(6L);
         actual.setPasswordPolicy(4L);
-        realmService.update(actual.getFullPath(), actual);
+        realmService.update(actual);
 
         actual = getRealm(actual.getFullPath());
         assertNotNull(actual.getAccountPolicy());
@@ -99,7 +99,7 @@ public class RealmITCase extends AbstractITCase {
 
         // 3. update changing parent
         actual.setParent(getRealm("/odd").getKey());
-        realmService.update(actual.getFullPath(), actual);
+        realmService.update(actual);
 
         actual = getRealm("/odd/last");
         assertNotNull(actual);

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
index 2199bc8..d02b726 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
@@ -116,7 +116,7 @@ public class ReportITCase extends AbstractITCase {
 
         report.getReportletConfs().add(new UserReportletConf("last"));
 
-        reportService.update(report.getKey(), report);
+        reportService.update(report);
         ReportTO updated = reportService.read(report.getKey());
         assertNotNull(updated);
         assertEquals(3, updated.getReportletConfs().size());

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
index a6dd805..c0e1790 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
@@ -329,7 +329,7 @@ public class ResourceITCase extends AbstractITCase {
         try {
             ResourceTO resourceTO = new ResourceTO();
             resourceTO.setKey("resourcenotfound");
-            resourceService.update(resourceTO.getKey(), resourceTO);
+            resourceService.update(resourceTO);
 
             fail();
         } catch (SyncopeClientException e) {
@@ -378,7 +378,7 @@ public class ResourceITCase extends AbstractITCase {
         item.setPurpose(MappingPurpose.BOTH);
         mapping.setConnObjectKeyItem(item);
 
-        resourceService.update(resourceTO.getKey(), resourceTO);
+        resourceService.update(resourceTO);
         ResourceTO actual = resourceService.read(resourceTO.getKey());
         assertNotNull(actual);
 
@@ -408,7 +408,7 @@ public class ResourceITCase extends AbstractITCase {
         resourceService.create(pre);
 
         pre.getProvision(AnyTypeKind.USER.name()).setSyncToken(null);
-        resourceService.update(pre.getKey(), pre);
+        resourceService.update(pre);
         ResourceTO actual = resourceService.read(pre.getKey());
         // check that the synctoken has been reset
         assertNull(actual.getProvision(AnyTypeKind.USER.name()).getSyncToken());
@@ -511,7 +511,7 @@ public class ResourceITCase extends AbstractITCase {
         assertNotNull(resource.getProvision(AnyTypeKind.USER.name()).getMapping());
 
         resource.getProvision(AnyTypeKind.USER.name()).setMapping(null);
-        resourceService.update(name, resource);
+        resourceService.update(resource);
 
         resource = resourceService.read(name);
         assertNotNull(resource);

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RoleITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RoleITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RoleITCase.java
index 4d61644..81b0796 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RoleITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RoleITCase.java
@@ -95,7 +95,7 @@ public class RoleITCase extends AbstractITCase {
         role.getEntitlements().add(Entitlement.WORKFLOW_TASK_LIST);
         role.getRealms().add("/even/two");
 
-        roleService.update(role.getKey(), role);
+        roleService.update(role);
 
         actual = roleService.read(role.getKey());
         assertTrue(actual.getEntitlements().contains(Entitlement.WORKFLOW_TASK_LIST));
@@ -133,7 +133,7 @@ public class RoleITCase extends AbstractITCase {
         assertTrue(userService.read(4L).getDynRoles().contains(role.getKey()));
 
         role.setDynMembershipCond("cool==false");
-        roleService.update(role.getKey(), role);
+        roleService.update(role);
 
         assertTrue(userService.read(4L).getDynGroups().isEmpty());
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
index e31190f..b65aa72 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
@@ -74,7 +74,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         taskMod.setKey(5);
         taskMod.setCronExpression(null);
 
-        taskService.update(taskMod.getKey(), taskMod);
+        taskService.update(taskMod);
         SchedTaskTO actual = taskService.read(taskMod.getKey());
         assertNotNull(actual);
         assertEquals(task.getKey(), actual.getKey());

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SecurityQuestionITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SecurityQuestionITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SecurityQuestionITCase.java
index 95a1988..36214c9 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SecurityQuestionITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SecurityQuestionITCase.java
@@ -72,7 +72,7 @@ public class SecurityQuestionITCase extends AbstractITCase {
         SecurityQuestionTO securityQuestionTO = securityQuestionService.read(1L);
         securityQuestionTO.setContent("What is your favorite color?");
 
-        securityQuestionService.update(securityQuestionTO.getKey(), securityQuestionTO);
+        securityQuestionService.update(securityQuestionTO);
         SecurityQuestionTO actual = securityQuestionService.read(securityQuestionTO.getKey());
         assertNotNull(actual);
         assertEquals(actual, securityQuestionTO);

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
index 939919f..f6d2e57 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
@@ -78,7 +78,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
     public static void testSyncActionsSetup() {
         SyncTaskTO syncTask = taskService.read(SYNC_TASK_ID);
         syncTask.getActionsClassNames().add(TestSyncActions.class.getName());
-        taskService.update(SYNC_TASK_ID, syncTask);
+        taskService.update(syncTask);
     }
 
     @Test
@@ -362,7 +362,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         assertNotNull(provision);
 
         provision.setSyncToken(null);
-        resourceService.update(resource.getKey(), resource);
+        resourceService.update(resource);
 
         // 1. create printer on external resource
         AnyObjectTO anyObjectTO = AnyObjectITCase.getSampleTO("sync");
@@ -449,7 +449,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
 
             task.getTemplates().put(AnyTypeKind.USER.name(), template);
 
-            taskService.update(task.getKey(), task);
+            taskService.update(task);
             SyncTaskTO actual = taskService.read(task.getKey());
             assertNotNull(actual);
             assertEquals(task.getKey(), actual.getKey());
@@ -514,7 +514,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         }
         item.setJavaRule(TestSyncRule.class.getName());
 
-        policyService.update(policyTO.getKey(), policyTO);
+        policyService.update(policyTO);
         // -----------------------------
 
         SyncTaskTO task = new SyncTaskTO();
@@ -548,7 +548,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         userMod.getPlainAttrsToRemove().add("email");
         userMod.getPlainAttrsToUpdate().add(attrMod("email", "s258@apache.org"));
 
-        userService.update(userMod.getKey(), userMod);
+        userService.update(userMod);
 
         execProvisioningTask(actual.getKey(), 50, false);
 
@@ -622,7 +622,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
 
         task.getTemplates().put(AnyTypeKind.USER.name(), template);
 
-        taskService.update(task.getKey(), task);
+        taskService.update(task);
         execProvisioningTask(task.getKey(), 50, false);
 
         // check for sync policy
@@ -736,7 +736,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         ConnConfProperty property = resourceConnector.getConfigurationMap().get("retrievePasswordsWithSearch");
         property.getValues().clear();
         property.getValues().add(Boolean.TRUE);
-        connectorService.update(ldapResource.getConnector(), resourceConnector);
+        connectorService.update(resourceConnector);
 
         // 6. Sync the user from the resource
         SyncTaskTO syncTask = new SyncTaskTO();
@@ -771,7 +771,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         taskService.delete(syncTask.getKey());
         property.getValues().clear();
         property.getValues().add(Boolean.FALSE);
-        connectorService.update(ldapResource.getConnector(), resourceConnector);
+        connectorService.update(resourceConnector);
         deleteUser(updatedUser.getKey());
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
index bd6b4aa..10b07bf 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
@@ -617,7 +617,7 @@ public class UserITCase extends AbstractITCase {
         userMod.setKey(userTO.getKey());
         userMod.setPassword("pass");
 
-        userService.update(userMod.getKey(), userMod);
+        userService.update(userMod);
     }
 
     @Test(expected = SyncopeClientException.class)
@@ -632,7 +632,7 @@ public class UserITCase extends AbstractITCase {
         userMod.setKey(userTO.getKey());
         userMod.setPassword("password123");
 
-        userService.update(userMod.getKey(), userMod);
+        userService.update(userMod);
     }
 
     @Test
@@ -1145,9 +1145,10 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(user);
 
         UserMod userMod = new UserMod();
+        userMod.setKey(user.getKey());
         userMod.setPassword("password321");
 
-        response = noContentService.update(user.getKey(), userMod);
+        response = noContentService.update(userMod);
         assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
         assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
         assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
@@ -1577,7 +1578,7 @@ public class UserITCase extends AbstractITCase {
                 item.setExtAttrName("uniqueMember");
             }
         }
-        resourceService.update(ldap.getKey(), ldap);
+        resourceService.update(ldap);
 
         // 1. create group with LDAP resource
         GroupTO groupTO = new GroupTO();
@@ -1625,7 +1626,7 @@ public class UserITCase extends AbstractITCase {
                 item.setExtAttrName("description");
             }
         }
-        resourceService.update(ldap.getKey(), ldap);
+        resourceService.update(ldap);
     }
 
     @Test
@@ -2026,8 +2027,9 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO);
 
         UserMod userMod = new UserMod();
+        userMod.setKey(userTO.getKey());
         userMod.setPassword("anotherPassword123");
-        userTO = userService.update(userTO.getKey(), userMod).readEntity(UserTO.class);
+        userTO = userService.update(userMod).readEntity(UserTO.class);
         assertNotNull(userTO);
     }
 
@@ -2041,9 +2043,10 @@ public class UserITCase extends AbstractITCase {
 
         // 2. try to update user by subscribing a resource - works but propagation is not
even attempted
         UserMod userMod = new UserMod();
+        userMod.setKey(userTO.getKey());
         userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
 
-        userTO = userService.update(userTO.getKey(), userMod).readEntity(UserTO.class);
+        userTO = userService.update(userMod).readEntity(UserTO.class);
         assertEquals(Collections.singleton(RESOURCE_NAME_WS1), userTO.getResources());
         assertFalse(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
         assertTrue(userTO.getPropagationStatusTOs().get(0).getFailureReason().
@@ -2064,7 +2067,7 @@ public class UserITCase extends AbstractITCase {
         UserMod userMod = new UserMod();
         userMod.setKey(userTO.getKey());
         userMod.setUsername(userTO.getUsername() + "XX");
-        userTO = userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
+        userTO = userService.update(userMod).readEntity(UserTO.class);
         assertTrue(userTO.getUsername().endsWith("XX"));
         EntityTag etag1 = adminClient.getLatestEntityTag(userService);
         assertFalse(etag.getValue().equals(etag1.getValue()));
@@ -2072,7 +2075,7 @@ public class UserITCase extends AbstractITCase {
         UserService ifMatchService = adminClient.ifMatch(UserService.class, etag);
         userMod.setUsername(userTO.getUsername() + "YY");
         try {
-            ifMatchService.update(userMod.getKey(), userMod);
+            ifMatchService.update(userMod);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.ConcurrentModification, e.getType());
@@ -2106,7 +2109,7 @@ public class UserITCase extends AbstractITCase {
         userMod.setPwdPropRequest(new StatusMod());
         userMod.getPlainAttrsToUpdate().add(attrMod("surname", "surname2"));
 
-        userService.update(userTO.getKey(), userMod);
+        userService.update(userMod);
 
         // 5. try (and succeed again) to perform simple LDAP binding: password has not changed
         assertNotNull(getLdapRemoteObject(
@@ -2145,7 +2148,7 @@ public class UserITCase extends AbstractITCase {
 
         ws1.getProvision(AnyTypeKind.USER.name()).setMapping(ws1NewUMapping);
 
-        resourceService.update(RESOURCE_NAME_WS1, ws1);
+        resourceService.update(ws1);
         ResourceTO newWs1 = resourceService.read(ws1.getKey());
         assertNotNull(newWs1);
 
@@ -2182,7 +2185,7 @@ public class UserITCase extends AbstractITCase {
 
         newWs1.getProvision(AnyTypeKind.USER.name()).setMapping(ws1NewUMapping);
 
-        resourceService.update(RESOURCE_NAME_WS1, newWs1);
+        resourceService.update(newWs1);
     }
 
     @Test
@@ -2198,7 +2201,7 @@ public class UserITCase extends AbstractITCase {
         ResourceTO resourceTO = resourceService.read(RESOURCE_NAME_TESTDB);
         assertNotNull(resourceTO);
         resourceTO.getPropagationActionsClassNames().add(DBPasswordPropagationActions.class.getName());
-        resourceService.update(RESOURCE_NAME_TESTDB, resourceTO);
+        resourceService.update(resourceTO);
 
         // 3. Add a db resource to the User
         UserMod userMod = new UserMod();
@@ -2224,7 +2227,7 @@ public class UserITCase extends AbstractITCase {
         resourceTO = resourceService.read(RESOURCE_NAME_TESTDB);
         assertNotNull(resourceTO);
         resourceTO.getPropagationActionsClassNames().remove(DBPasswordPropagationActions.class.getName());
-        resourceService.update(RESOURCE_NAME_TESTDB, resourceTO);
+        resourceService.update(resourceTO);
     }
 
     @Test
@@ -2241,7 +2244,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(resourceTO);
         resourceTO.getPropagationActionsClassNames().add(LDAPPasswordPropagationActions.class.getName());
         resourceTO.setRandomPwdIfNotProvided(false);
-        resourceService.update(RESOURCE_NAME_LDAP, resourceTO);
+        resourceService.update(resourceTO);
 
         // 3. Add a resource to the User
         UserMod userMod = new UserMod();
@@ -2271,7 +2274,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(resourceTO);
         resourceTO.getPropagationActionsClassNames().remove(LDAPPasswordPropagationActions.class.getName());
         resourceTO.setRandomPwdIfNotProvided(true);
-        resourceService.update(RESOURCE_NAME_LDAP, resourceTO);
+        resourceService.update(resourceTO);
     }
 
     @Test
@@ -2360,7 +2363,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(csv);
         try {
             csv.setPasswordPolicy(8L);
-            resourceService.update(RESOURCE_NAME_CSV, csv);
+            resourceService.update(csv);
             csv = resourceService.read(RESOURCE_NAME_CSV);
 
             userTO = getUniqueSampleTO("syncope391@syncope.apache.org");
@@ -2379,7 +2382,7 @@ public class UserITCase extends AbstractITCase {
         } finally {
             // resource csv with null password policy
             csv.setPasswordPolicy(null);
-            resourceService.update(RESOURCE_NAME_CSV, csv);
+            resourceService.update(csv);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
index fdd25bd..2944cdc 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
@@ -148,10 +148,11 @@ public class UserSelfITCase extends AbstractITCase {
 
         // 2. self-update (username) - works
         UserMod userMod = new UserMod();
+        userMod.setKey(created.getKey());
         userMod.setUsername(created.getUsername() + "XX");
 
         SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
-        UserTO updated = authClient.getService(UserSelfService.class).update(created.getKey(),
userMod).
+        UserTO updated = authClient.getService(UserSelfService.class).update(userMod).
                 readEntity(UserTO.class);
         assertNotNull(updated);
         assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
@@ -170,6 +171,7 @@ public class UserSelfITCase extends AbstractITCase {
 
         // 2. self-update (username + memberships + resource) - works but needs approval
         UserMod userMod = new UserMod();
+        userMod.setKey(created.getKey());
         userMod.setUsername(created.getUsername() + "XX");
         userMod.getMembershipsToAdd().add(7L);
         userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
@@ -180,7 +182,7 @@ public class UserSelfITCase extends AbstractITCase {
         userMod.setPwdPropRequest(statusMod);
 
         SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
-        UserTO updated = authClient.getService(UserSelfService.class).update(created.getKey(),
userMod).
+        UserTO updated = authClient.getService(UserSelfService.class).update(userMod).
                 readEntity(UserTO.class);
         assertNotNull(updated);
         assertEquals("updateApproval", updated.getStatus());

http://git-wip-us.apache.org/repos/asf/syncope/blob/df60b3b4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
index 2c2065f..3fc1b98 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
@@ -281,7 +281,7 @@ public class VirAttrITCase extends AbstractITCase {
                 }
             }
 
-            resourceService.update(csv.getKey(), csv);
+            resourceService.update(csv);
             csv = resourceService.read(RESOURCE_NAME_CSV);
             assertNotNull(csv.getProvisions().get(0).getMapping());
 
@@ -337,7 +337,7 @@ public class VirAttrITCase extends AbstractITCase {
         } finally {
             // restore mapping of resource-csv
             csv.getProvisions().get(0).setMapping(origMapping);
-            resourceService.update(csv.getKey(), csv);
+            resourceService.update(csv);
         }
     }
 
@@ -376,7 +376,7 @@ public class VirAttrITCase extends AbstractITCase {
             }
         }
 
-        connectorService.update(connInstanceBean.getKey(), connInstanceBean);
+        connectorService.update(connInstanceBean);
 
         UserMod userMod = new UserMod();
         userMod.setKey(actual.getKey());
@@ -421,7 +421,7 @@ public class VirAttrITCase extends AbstractITCase {
             }
         }
 
-        connectorService.update(connInstanceBean.getKey(), connInstanceBean);
+        connectorService.update(connInstanceBean);
         // ----------------------------------------
 
         actual = userService.read(actual.getKey());


Mime
View raw message