syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [07/10] syncope git commit: [SYNCOPE-1262] Remove matrix parameters - OpenApi wins :-(
Date Tue, 13 Feb 2018 13:29:09 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/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 751516d..e79c3f7 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
@@ -81,7 +81,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
     @Test
     public void read() {
         PushTaskTO pushTaskTO = taskService.<PushTaskTO>read(
-                "0bc11a19-6454-45c2-a4e3-ceef84e5d79b", true);
+                TaskType.PUSH, "0bc11a19-6454-45c2-a4e3-ceef84e5d79b", true);
         assertEquals(UnmatchingRule.ASSIGN, pushTaskTO.getUnmatchingRule());
         assertEquals(MatchingRule.UPDATE, pushTaskTO.getMatchingRule());
     }
@@ -109,11 +109,11 @@ public class PushTaskITCase extends AbstractTaskITCase {
                 SyncopeClient.getGroupSearchConditionBuilder().isNotNull("cool").query());
         task.setMatchingRule(MatchingRule.LINK);
 
-        final Response response = taskService.create(task);
+        final Response response = taskService.create(TaskType.PUSH, task);
         final PushTaskTO actual = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
         assertNotNull(actual);
 
-        task = taskService.read(actual.getKey(), true);
+        task = taskService.read(TaskType.PUSH, actual.getKey(), true);
         assertNotNull(task);
         assertEquals(task.getKey(), actual.getKey());
         assertEquals(task.getJobDelegateClassName(), actual.getJobDelegateClassName());
@@ -130,7 +130,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         assertFalse(groupService.read("29f96485-729e-4d31-88a1-6fc60e4677f3").
                 getResources().contains(RESOURCE_NAME_LDAP));
 
-        execProvisioningTask(taskService, "fd905ba5-9d56-4f51-83e2-859096a67b75", 50, false);
+        execProvisioningTask(taskService, TaskType.PUSH, "fd905ba5-9d56-4f51-83e2-859096a67b75",
50, false);
 
         assertNotNull(resourceService.readConnObject(
                 RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), "29f96485-729e-4d31-88a1-6fc60e4677f3"));
@@ -155,7 +155,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         // ------------------------------------------
         // Unmatching --> Assign --> dryRuyn
         // ------------------------------------------
-        execProvisioningTask(taskService, "af558be4-9d2f-4359-bf85-a554e6e90be1", 50, true);
+        execProvisioningTask(taskService, TaskType.PUSH, "af558be4-9d2f-4359-bf85-a554e6e90be1",
50, true);
         assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='vivaldi'").size());
         assertFalse(userService.read("b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee").
                 getResources().contains(RESOURCE_NAME_TESTDB2));
@@ -166,7 +166,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         pushTaskKeys.add("97f327b6-2eff-4d35-85e8-d581baaab855");
         pushTaskKeys.add("03aa2a04-4881-4573-9117-753f81b04865");
         pushTaskKeys.add("5e5f7c7e-9de7-4c6a-99f1-4df1af959807");
-        execProvisioningTasks(taskService, pushTaskKeys, 50, false);
+        execProvisioningTasks(taskService, TaskType.PUSH, pushTaskKeys, 50, false);
 
         // ------------------------------------------
         // Unatching --> Ignore
@@ -217,7 +217,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         // ------------------------------------------
         // Matching --> Deprovision --> dryRuyn
         // ------------------------------------------
-        execProvisioningTask(taskService, "c46edc3a-a18b-4af2-b707-f4a415507496", 50, true);
+        execProvisioningTask(taskService, TaskType.PUSH, "c46edc3a-a18b-4af2-b707-f4a415507496",
50, true);
         assertTrue(userService.read("1417acbe-cbf6-4277-9372-e75e04f97000").
                 getResources().contains(RESOURCE_NAME_TESTDB2));
         assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
@@ -228,7 +228,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         pushTaskKeys.add("c46edc3a-a18b-4af2-b707-f4a415507496");
         pushTaskKeys.add("5e5f7c7e-9de7-4c6a-99f1-4df1af959807");
 
-        execProvisioningTasks(taskService, pushTaskKeys, 50, false);
+        execProvisioningTasks(taskService, TaskType.PUSH, pushTaskKeys, 50, false);
 
         // ------------------------------------------
         // Matching --> Deprovision && Ignore
@@ -251,7 +251,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         // ------------------------------------------
         // Matching --> Link
         // ------------------------------------------
-        execProvisioningTask(taskService, "51318433-cce4-4f71-8f45-9534b6c9c819", 50, false);
+        execProvisioningTask(taskService, TaskType.PUSH, "51318433-cce4-4f71-8f45-9534b6c9c819",
50, false);
         assertTrue(userService.read("74cd8ece-715a-44a4-a736-e17b46c4e7e6").
                 getResources().contains(RESOURCE_NAME_TESTDB2));
         assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
@@ -261,7 +261,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         pushTaskKeys.add("24b1be9c-7e3b-443a-86c9-798ebce5eaf2");
         pushTaskKeys.add("375c7b7f-9e3a-4833-88c9-b7787b0a69f2");
 
-        execProvisioningTasks(taskService, pushTaskKeys, 50, false);
+        execProvisioningTasks(taskService, TaskType.PUSH, pushTaskKeys, 50, false);
 
         // ------------------------------------------
         // Matching --> Unlink && Update
@@ -288,11 +288,11 @@ public class PushTaskITCase extends AbstractTaskITCase {
         task.setPerformDelete(true);
         task.setPerformUpdate(true);
 
-        Response response = taskService.create(task);
+        Response response = taskService.create(TaskType.PUSH, task);
         PushTaskTO pushTask = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
         assertNotNull(pushTask);
 
-        ExecTO exec = execProvisioningTask(taskService, pushTask.getKey(), 50, false);
+        ExecTO exec = execProvisioningTask(taskService, TaskType.PUSH, pushTask.getKey(),
50, false);
         assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
 
         // 2. check
@@ -375,12 +375,12 @@ public class PushTaskITCase extends AbstractTaskITCase {
             task.getFilters().put(AnyTypeKind.GROUP.name(),
                     SyncopeClient.getGroupSearchConditionBuilder().is("name").equalTo(groupTO.getName()).query());
 
-            response = taskService.create(task);
+            response = taskService.create(TaskType.PUSH, task);
             PushTaskTO push = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
             assertNotNull(push);
 
             // execute the new task
-            ExecTO exec = execProvisioningTask(taskService, push.getKey(), 50, false);
+            ExecTO exec = execProvisioningTask(taskService, TaskType.PUSH, push.getKey(),
50, false);
             assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
         } finally {
             groupService.delete(groupTO.getKey());
@@ -405,7 +405,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         task.setMatchingRule(MatchingRule.IGNORE);
         task.setUnmatchingRule(UnmatchingRule.IGNORE);
 
-        Response response = taskService.create(task);
+        Response response = taskService.create(TaskType.PUSH, task);
         PushTaskTO actual = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
         assertNotNull(actual);
 
@@ -429,7 +429,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
         notification = getObject(responseNotification.getLocation(), NotificationService.class,
NotificationTO.class);
         assertNotNull(notification);
 
-        execProvisioningTask(taskService, actual.getKey(), 50, false);
+        execProvisioningTask(taskService, TaskType.PUSH, actual.getKey(), 50, false);
 
         NotificationTaskTO taskTO = findNotificationTask(notification.getKey(), 50);
         assertNotNull(taskTO);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
index bbe9ac5..94fe099 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
@@ -37,6 +37,7 @@ import org.apache.syncope.common.lib.to.RealmTO;
 import org.apache.syncope.common.lib.policy.DefaultAccountRuleConf;
 import org.apache.syncope.common.lib.to.ProvisioningResult;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.PolicyType;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.common.rest.api.service.RealmService;
 import org.apache.syncope.fit.AbstractITCase;
@@ -142,7 +143,7 @@ public class RealmITCase extends AbstractITCase {
         ruleConf.setMaxLength(8);
         policy.getRuleConfs().add(ruleConf);
 
-        policy = createPolicy(policy);
+        policy = createPolicy(PolicyType.ACCOUNT, policy);
         assertNotNull(policy);
 
         // 2. create realm with policy assigned
@@ -158,7 +159,7 @@ public class RealmITCase extends AbstractITCase {
         assertEquals(policy.getKey(), actual.getAccountPolicy());
 
         // 3. remove policy
-        policyService.delete(policy.getKey());
+        policyService.delete(PolicyType.ACCOUNT, policy.getKey());
 
         // 4. verify
         actual = getRealm(actual.getFullPath());

http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
index 858a520..3ae3a6d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
@@ -71,7 +71,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
 
     @Test
     public void update() {
-        SchedTaskTO task = taskService.read(SCHED_TASK_KEY, true);
+        SchedTaskTO task = taskService.read(TaskType.SCHEDULED, SCHED_TASK_KEY, true);
         assertNotNull(task);
 
         SchedTaskTO taskMod = new SchedTaskTO();
@@ -79,8 +79,8 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         taskMod.setName(task.getName());
         taskMod.setCronExpression(null);
 
-        taskService.update(taskMod);
-        SchedTaskTO actual = taskService.read(taskMod.getKey(), true);
+        taskService.update(TaskType.SCHEDULED, taskMod);
+        SchedTaskTO actual = taskService.read(TaskType.SCHEDULED, taskMod.getKey(), true);
         assertNotNull(actual);
         assertEquals(task.getKey(), actual.getKey());
         assertNull(actual.getCronExpression());
@@ -93,7 +93,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         task.setName("deferred");
         task.setJobDelegateClassName(TestSampleJobDelegate.class.getName());
 
-        Response response = taskService.create(task);
+        Response response = taskService.create(TaskType.SCHEDULED, task);
         task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
         assertNotNull(task);
 
@@ -112,7 +112,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
             } catch (InterruptedException e) {
             }
 
-            task = taskService.read(task.getKey(), true);
+            task = taskService.read(TaskType.SCHEDULED, task.getKey(), true);
 
             assertNotNull(task);
             assertNotNull(task.getExecutions());
@@ -135,13 +135,13 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         task.setDescription("issueSYNCOPE144 Description");
         task.setJobDelegateClassName(TestSampleJobDelegate.class.getName());
 
-        Response response = taskService.create(task);
+        Response response = taskService.create(TaskType.SCHEDULED, task);
         task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
         assertNotNull(task);
         assertEquals("issueSYNCOPE144", task.getName());
         assertEquals("issueSYNCOPE144 Description", task.getDescription());
 
-        task = taskService.read(task.getKey(), true);
+        task = taskService.read(TaskType.SCHEDULED, task.getKey(), true);
         assertNotNull(task);
         assertEquals("issueSYNCOPE144", task.getName());
         assertEquals("issueSYNCOPE144 Description", task.getDescription());
@@ -149,7 +149,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         task.setName("issueSYNCOPE144_2");
         task.setDescription("issueSYNCOPE144 Description_2");
 
-        response = taskService.create(task);
+        response = taskService.create(TaskType.SCHEDULED, task);
         task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
         assertNotNull(task);
         assertEquals("issueSYNCOPE144_2", task.getName());
@@ -166,7 +166,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         task.setDescription("issueSYNCOPE660 Description");
         task.setJobDelegateClassName(TestSampleJobDelegate.class.getName());
 
-        Response response = taskService.create(task);
+        Response response = taskService.create(TaskType.SCHEDULED, task);
         task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
 
         jobs = taskService.listJobs();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
index 77e1072..166ed86 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
@@ -70,6 +70,7 @@ import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.common.lib.types.PatchOperation;
+import org.apache.syncope.common.lib.types.PolicyType;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.common.lib.types.ResourceAssociationAction;
 import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
@@ -262,7 +263,7 @@ public class UserITCase extends AbstractITCase {
         assertFalse(tasks.getResult().isEmpty());
 
         String maxKey = tasks.getResult().iterator().next().getKey();
-        PropagationTaskTO taskTO = taskService.read(maxKey, true);
+        PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, maxKey, true);
 
         assertNotNull(taskTO);
         int maxTaskExecutions = taskTO.getExecutions().size();
@@ -310,7 +311,7 @@ public class UserITCase extends AbstractITCase {
         assertEquals(newMaxKey, maxKey);
 
         // get last task
-        taskTO = taskService.read(newMaxKey, true);
+        taskTO = taskService.read(TaskType.PROPAGATION, newMaxKey, true);
 
         assertNotNull(taskTO);
         assertEquals(maxTaskExecutions, taskTO.getExecutions().size());
@@ -662,7 +663,7 @@ public class UserITCase extends AbstractITCase {
         // all update executions have to be registered
         newMaxKey = tasks.getResult().iterator().next().getKey();
 
-        PropagationTaskTO taskTO = taskService.read(newMaxKey, true);
+        PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, newMaxKey, true);
 
         assertNotNull(taskTO);
         assertEquals(1, taskTO.getExecutions().size());
@@ -928,13 +929,13 @@ public class UserITCase extends AbstractITCase {
         AccountPolicyTO accountPolicy = new AccountPolicyTO();
         accountPolicy.setDescription("Account Policy with custom rules");
         accountPolicy.getRuleConfs().add(new TestAccountRuleConf());
-        accountPolicy = createPolicy(accountPolicy);
+        accountPolicy = createPolicy(PolicyType.ACCOUNT, accountPolicy);
         assertNotNull(accountPolicy);
 
         PasswordPolicyTO passwordPolicy = new PasswordPolicyTO();
         passwordPolicy.setDescription("Password Policy with custom rules");
         passwordPolicy.getRuleConfs().add(new TestPasswordRuleConf());
-        passwordPolicy = createPolicy(passwordPolicy);
+        passwordPolicy = createPolicy(PolicyType.PASSWORD, passwordPolicy);
         assertNotNull(passwordPolicy);
 
         RealmTO realm = realmService.list("/even/two").get(0);
@@ -972,8 +973,8 @@ public class UserITCase extends AbstractITCase {
             realm.setPasswordPolicy(oldPasswordPolicy);
             realmService.update(realm);
 
-            policyService.delete(passwordPolicy.getKey());
-            policyService.delete(accountPolicy.getKey());
+            policyService.delete(PolicyType.PASSWORD, passwordPolicy.getKey());
+            policyService.delete(PolicyType.ACCOUNT, accountPolicy.getKey());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
index 716300e..f785884 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
@@ -67,6 +67,7 @@ import org.apache.syncope.common.lib.types.CipherAlgorithm;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.common.lib.types.MappingPurpose;
 import org.apache.syncope.common.lib.types.PatchOperation;
+import org.apache.syncope.common.lib.types.PolicyType;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.core.provisioning.java.propagation.DBPasswordPropagationActions;
 import org.apache.syncope.core.provisioning.java.propagation.LDAPPasswordPropagationActions;
@@ -1192,7 +1193,7 @@ public class UserIssuesITCase extends AbstractITCase {
         ruleConf.setUsernameAllowed(false);
         passwordPolicy.getRuleConfs().add(ruleConf);
 
-        passwordPolicy = createPolicy(passwordPolicy);
+        passwordPolicy = createPolicy(PolicyType.PASSWORD, passwordPolicy);
         assertNotNull(passwordPolicy);
 
         RealmTO realm = realmService.list("/even/two").get(0);
@@ -1219,7 +1220,7 @@ public class UserIssuesITCase extends AbstractITCase {
             realm.setPasswordPolicy(oldPasswordPolicy);
             realmService.update(realm);
 
-            policyService.delete(passwordPolicy.getKey());
+            policyService.delete(PolicyType.PASSWORD, passwordPolicy.getKey());
         }
 
     }


Mime
View raw message