// update user virtual attribute and check virtual attribute value update propagation
// ----------------------------------
UserMod userMod = new UserMod();
userMod.setId(userTO.getId());
AttributeMod attrMod = new AttributeMod();
attrMod.setSchema("virtualdata");
attrMod.addValueToBeRemoved("virtualvalue");
attrMod.addValueToBeAdded("virtualvalue2");
userMod.addVirtualAttributeToBeUpdated(attrMod);
userTO = userService.update(userMod.getId(), userMod);
assertNotNull(userTO);
assertFalse(userTO.getPropagationStatusTOs().isEmpty());
assertEquals("ws-target-resource-2", userTO.getPropagationStatusTOs().get(0).getResource());
assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
connObjectTO = readConnectorObject("ws-target-resource-2", userTO.getId());
assertNotNull(connObjectTO);
assertEquals("virtualvalue2", connObjectTO.getAttributeMap().get("NAME").getValues().get(0));
// ----------------------------------
// ----------------------------------
// suspend/reactivate user and check virtual attribute value (unchanged)
// ----------------------------------
userTO = userService.suspend(userTO.getId());
assertEquals("suspended", userTO.getStatus());
connObjectTO = readConnectorObject("ws-target-resource-2", userTO.getId());
assertNotNull(connObjectTO);
assertFalse(connObjectTO.getAttributeMap().get("NAME").getValues().isEmpty());
assertEquals("virtualvalue2", connObjectTO.getAttributeMap().get("NAME").getValues().get(0));
userTO = userService.reactivate(userTO.getId());
assertEquals("active", userTO.getStatus());
connObjectTO = readConnectorObject("ws-target-resource-2", userTO.getId());
assertNotNull(connObjectTO);
assertFalse(connObjectTO.getAttributeMap().get("NAME").getValues().isEmpty());
assertEquals("virtualvalue2", connObjectTO.getAttributeMap().get("NAME").getValues().get(0));
// ----------------------------------
// ----------------------------------
// update user attribute and check virtual attribute value (unchanged)
// ----------------------------------
userMod = new UserMod();
userMod.setId(userTO.getId());
attrMod = new AttributeMod();
attrMod.setSchema("surname");
attrMod.addValueToBeRemoved("Surname");
attrMod.addValueToBeAdded("Surname2");
userMod.addAttributeToBeUpdated(attrMod);
userTO = userService.update(userMod.getId(), userMod);
assertNotNull(userTO);