assertNotNull(tasks);
assertFalse(tasks.getResult().isEmpty());
long maxId = getMaxTaskId(tasks.getResult());
PropagationTaskTO taskTO = taskService.read(maxId);
assertNotNull(taskTO);
int maxTaskExecutions = taskTO.getExecutions().size();
UserTO userTO = getUniqueSampleTO("a.b@c.com");
// add a membership
MembershipTO membershipTO = new MembershipTO();
membershipTO.setRoleId(8L);
userTO.getMemberships().add(membershipTO);
// add an attribute with no values: must be ignored
membershipTO.getAttrs().add(attributeTO("subscriptionDate", null));
// add an attribute with a non-existing schema: must be ignored
AttributeTO attrWithInvalidSchemaTO = attributeTO("invalid schema", "a value");
userTO.getAttrs().add(attrWithInvalidSchemaTO);
// add an attribute with null value: must be ignored
userTO.getAttrs().add(attributeTO("activationDate", null));
// 1. create user
UserTO newUserTO = createUser(userTO);
assertNotNull(newUserTO);
// issue SYNCOPE-15
assertNotNull(newUserTO.getCreationDate());
assertNotNull(newUserTO.getCreator());
assertNotNull(newUserTO.getLastChangeDate());
assertNotNull(newUserTO.getLastModifier());
assertEquals(newUserTO.getCreationDate(), newUserTO.getLastChangeDate());
assertFalse(newUserTO.getAttrs().contains(attrWithInvalidSchemaTO));
// check for changePwdDate
assertNotNull(newUserTO.getCreationDate());
// 2. check for virtual attribute value
newUserTO = userService.read(newUserTO.getId());
assertNotNull(newUserTO);
assertNotNull(newUserTO.getVirAttrMap());
assertNotNull(newUserTO.getVirAttrMap().get("virtualdata").getValues());
assertFalse(newUserTO.getVirAttrMap().get("virtualdata").getValues().isEmpty());
assertEquals("virtualvalue", newUserTO.getVirAttrMap().get("virtualdata").getValues().get(0));
// get the new task list
tasks = taskService.list(TaskType.PROPAGATION);
assertNotNull(tasks);
assertFalse(tasks.getResult().isEmpty());
long newMaxId = getMaxTaskId(tasks.getResult());
// default configuration for ws-target-resource2:
// only failed executions have to be registered
// --> no more tasks/executions should be added
assertEquals(newMaxId, maxId);
// get last task
taskTO = taskService.read(newMaxId);
assertNotNull(taskTO);
assertEquals(maxTaskExecutions, taskTO.getExecutions().size());
// 3. verify password
UserSelfService userSelfService1 = clientFactory.create(
newUserTO.getUsername(), "password123").getService(UserSelfService.class);
try {