You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by md...@apache.org on 2013/11/18 17:40:25 UTC
svn commit: r1543073 -
/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
Author: mdisabatino
Date: Mon Nov 18 16:40:25 2013
New Revision: 1543073
URL: http://svn.apache.org/r1543073
Log:
SYNCOPE-436 Merge from 1_1_X
Modified:
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java?rev=1543073&r1=1543072&r2=1543073&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java Mon Nov 18 16:40:25 2013
@@ -394,7 +394,7 @@ public class TaskTestITCase extends Abst
SyncTaskTO task = taskService.read(11L);
assertNotNull(task);
- // add role template
+ // add user template
final UserTO userTemplate = task.getUserTemplate();
userTemplate.getResources().add("resource-ldap");
userTemplate.getVirAttrs().add(attributeTO("virtualReadOnly", ""));
@@ -437,6 +437,8 @@ public class TaskTestITCase extends Abst
final List<UserTO> matchingUsers = userService.search(NodeCond.getLeafCond(usernameLeafCond));
assertNotNull(matchingUsers);
assertEquals(1, matchingUsers.size());
+ // Check for SYNCOPE-436
+ assertEquals("syncFromLDAP", matchingUsers.get(0).getVirAttrMap().get("virtualReadOnly").getValues().get(0));
final RoleTO roleTO = matchingRoles.iterator().next();
assertNotNull(roleTO);
@@ -931,35 +933,4 @@ public class TaskTestITCase extends Abst
assertFalse(taskService.list(TaskType.PROPAGATION).containsAll(after));
}
-
- @Test
- public void issueSYNCOPE436() throws InvalidSearchConditionException {
-
- SyncTaskTO task = taskService.read(11L);
- assertNotNull(task);
-
- final UserTO template = task.getUserTemplate();
- template.getResources().add("resource-ldap");
- template.getVirAttrs().add(attributeTO("virtualReadOnly", ""));
- task.setUserTemplate(template);
-
- taskService.update(task.getId(), task);
- TaskExecTO execution = execSyncTask(11L, 50, false);
-
- final String status = execution.getStatus();
- assertNotNull(status);
- assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
-
- final AttributableCond usernameLeafCond = new AttributableCond(AttributeCond.Type.EQ);
- usernameLeafCond.setSchema("username");
- usernameLeafCond.setExpression("syncFromLDAP");
-
- final List<UserTO> matchingUsers = userService.search(NodeCond.getLeafCond(usernameLeafCond));
- assertNotNull(matchingUsers);
- assertEquals(1, matchingUsers.size());
-
- final UserTO syncUser = matchingUsers.iterator().next();
- final AttributeTO virAttributeTO = syncUser.getVirAttrMap().get("virtualReadOnly");
- assertEquals("syncFromLDAP", virAttributeTO.getValues().get(0));
- }
}