? "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
StatusMod statusMod = new StatusMod();
statusMod.setType(StatusMod.ModType.SUSPEND);
statusMod.setOnSyncope(true);
statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
statusMod.getResourceNames().add(RESOURCE_NAME_LDAP);
userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
assertNotNull(userTO);
assertEquals("suspended", userTO.getStatus());
ConnObjectTO connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userId);
assertNotNull(connObjectTO);
// Suspend and reactivate only on ldap => db and syncope should still show suspended
statusMod = new StatusMod();
statusMod.setType(StatusMod.ModType.SUSPEND);
statusMod.setOnSyncope(false);
statusMod.getResourceNames().add(RESOURCE_NAME_LDAP);
userService.status(userId, statusMod);
statusMod.setType(StatusMod.ModType.REACTIVATE);
userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
assertNotNull(userTO);
assertEquals("suspended", userTO.getStatus());
connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
// Reactivate on syncope and db => syncope and db should show the user as active
statusMod = new StatusMod();
statusMod.setType(StatusMod.ModType.REACTIVATE);
statusMod.setOnSyncope(true);
statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());