? "active"
: "created", userTO.getStatus());
long userId = userTO.getId();
// Suspend with effect on syncope, ldap and db => user should be suspended in syncope and all resources
PropagationRequestTO propagationRequestTO = new PropagationRequestTO();
propagationRequestTO.setOnSyncope(true);
propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);
propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
userTO = userService.suspend(userId, propagationRequestTO);
assertNotNull(userTO);
assertEquals("suspended", userTO.getStatus());
ConnObjectTO connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId, AttributableType.USER);
assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
connObjectTO = readConnectorObject(RESOURCE_NAME_LDAP, userId, AttributableType.USER);
assertNotNull(connObjectTO);
// Suspend and reactivate only on ldap => db and syncope should still show suspended
propagationRequestTO = new PropagationRequestTO();
propagationRequestTO.setOnSyncope(false);
propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
userService.suspend(userId, propagationRequestTO);
userTO = userService.reactivate(userId, propagationRequestTO);
assertNotNull(userTO);
assertEquals("suspended", userTO.getStatus());
connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId, AttributableType.USER);
assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
// Reactivate on syncope and db => syncope and db should show the user as active
propagationRequestTO = new PropagationRequestTO();
propagationRequestTO.setOnSyncope(true);
propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);
userTO = userService.reactivate(userId, propagationRequestTO);
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());