syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/4] syncope git commit: Cleanup: now UserService#read and GroupService#read are able to read either via key (UUID) or username / name
Date Wed, 20 Apr 2016 11:02:37 GMT
Cleanup: now UserService#read and GroupService#read are able to read either via key (UUID)
or username / name


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/f2bbd939
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/f2bbd939
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/f2bbd939

Branch: refs/heads/master
Commit: f2bbd9392020f7b50a15e12f515f8faa462b9f59
Parents: f99f36e
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Apr 20 10:50:40 2016 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Apr 20 10:50:40 2016 +0200

----------------------------------------------------------------------
 .../org/apache/syncope/fit/AbstractITCase.java  |  4 ---
 .../syncope/fit/core/AbstractTaskITCase.java    |  2 +-
 .../syncope/fit/core/AuthenticationITCase.java  |  2 +-
 .../apache/syncope/fit/core/PullTaskITCase.java | 28 ++++++++++----------
 4 files changed, 16 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/f2bbd939/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
index d3f8793..e781b09 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
@@ -314,10 +314,6 @@ public abstract class AbstractITCase {
         return getObject(response.getLocation(), RoleService.class, RoleTO.class);
     }
 
-    protected UserTO readUser(final String username) {
-        return userService.read(username);
-    }
-
     protected ProvisioningResult<UserTO> createUser(final UserTO userTO) {
         return createUser(userTO, true);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/f2bbd939/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
index 6f1e677..d3b0192 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
@@ -83,7 +83,7 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
         for (int i = 0; i < 10; i++) {
             String cUserName = "test" + i;
             try {
-                UserTO cUserTO = readUser(cUserName);
+                UserTO cUserTO = userService.read(cUserName);
                 userService.delete(cUserTO.getKey());
             } catch (Exception e) {
                 // Ignore

http://git-wip-us.apache.org/repos/asf/syncope/blob/f2bbd939/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
index 2ea5c65..781f89b 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
@@ -452,7 +452,7 @@ public class AuthenticationITCase extends AbstractITCase {
         role.getEntitlements().add(anyTypeKey + "_CREATE");
         role = createRole(role);
 
-        UserTO bellini = readUser("bellini");
+        UserTO bellini = userService.read("bellini");
         UserPatch patch = new UserPatch();
         patch.setKey(bellini.getKey());
         patch.getRoles().add(new StringPatchItem.Builder().

http://git-wip-us.apache.org/repos/asf/syncope/blob/f2bbd939/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index ff0ccbb..864835d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -194,7 +194,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
             assertFalse(userTO.getResources().contains(RESOURCE_NAME_CSV));
 
             // check for user template
-            userTO = readUser("test7");
+            userTO = userService.read("test7");
             assertNotNull(userTO);
             assertEquals("TYPE_OTHER", userTO.getPlainAttrMap().get("ctype").getValues().get(0));
             assertEquals(3, userTO.getResources().size());
@@ -213,13 +213,13 @@ public class PullTaskITCase extends AbstractTaskITCase {
                 }
             }));
 
-            userTO = readUser("test8");
+            userTO = userService.read("test8");
             assertNotNull(userTO);
             assertEquals("TYPE_8", userTO.getPlainAttrMap().get("ctype").getValues().get(0));
 
             // Check for ignored user - SYNCOPE-663
             try {
-                readUser("test2");
+                userService.read("test2");
                 fail();
             } catch (SyncopeClientException e) {
                 assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
@@ -235,11 +235,11 @@ public class PullTaskITCase extends AbstractTaskITCase {
             // Check for issue 215:
             // * expected disabled user test1
             // * expected enabled user test3
-            userTO = readUser("test1");
+            userTO = userService.read("test1");
             assertNotNull(userTO);
             assertEquals("suspended", userTO.getStatus());
 
-            userTO = readUser("test3");
+            userTO = userService.read("test3");
             assertNotNull(userTO);
             assertEquals("active", userTO.getStatus());
 
@@ -249,8 +249,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
             execProvisioningTasks(taskService, otherPullTaskKeys, 50, false);
 
             // Matching --> UNLINK
-            assertFalse(readUser("test9").getResources().contains(RESOURCE_NAME_CSV));
-            assertFalse(readUser("test7").getResources().contains(RESOURCE_NAME_CSV));
+            assertFalse(userService.read("test9").getResources().contains(RESOURCE_NAME_CSV));
+            assertFalse(userService.read("test7").getResources().contains(RESOURCE_NAME_CSV));
         } finally {
             removeTestUsers();
         }
@@ -274,7 +274,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
             assertNotNull(execution.getStatus());
             assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
 
-            userTO = readUser("testuser1");
+            userTO = userService.read("testuser1");
             assertNotNull(userTO);
             assertEquals("reconciled@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
             assertEquals("suspended", userTO.getStatus());
@@ -288,7 +288,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
             assertNotNull(execution.getStatus());
             assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
 
-            userTO = readUser("testuser1");
+            userTO = userService.read("testuser1");
             assertNotNull(userTO);
             assertEquals("active", userTO.getStatus());
         } finally {
@@ -488,11 +488,11 @@ public class PullTaskITCase extends AbstractTaskITCase {
             assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
 
             // 4. verify that only enabled user was pulled
-            userTO = readUser("user2");
+            userTO = userService.read("user2");
             assertNotNull(userTO);
 
             try {
-                readUser("user1");
+                userService.read("user1");
                 fail();
             } catch (SyncopeClientException e) {
                 assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -567,7 +567,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
             ExecTO execution = execProvisioningTask(taskService, actual.getKey(), 50, false);
             assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
 
-            userTO = readUser("testuser2");
+            userTO = userService.read("testuser2");
             assertNotNull(userTO);
             assertEquals("testuser2@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
             assertEquals(2, userTO.getMemberships().size());
@@ -584,7 +584,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
         execProvisioningTask(taskService, "7c2242f4-14af-4ab5-af31-cdae23783655", 50, false);
 
         // 3. read e-mail address for user created by the PullTask first execution
-        UserTO userTO = readUser("issuesyncope230");
+        UserTO userTO = userService.read("issuesyncope230");
         assertNotNull(userTO);
         String email = userTO.getPlainAttrMap().get("email").getValues().iterator().next();
         assertNotNull(email);
@@ -597,7 +597,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
         execProvisioningTask(taskService, "7c2242f4-14af-4ab5-af31-cdae23783655", 50, false);
 
         // 6. verify that the e-mail was updated
-        userTO = readUser("issuesyncope230");
+        userTO = userService.read("issuesyncope230");
         assertNotNull(userTO);
         email = userTO.getPlainAttrMap().get("email").getValues().iterator().next();
         assertNotNull(email);


Mime
View raw message