}
@Test
public void isseSYNCOPE136AES() {
// 1. read configured cipher algorithm in order to be able to restore it at the end of test
ConfigurationTO pwdCipherAlgo = configurationService.read("password.cipher.algorithm");
final String origpwdCipherAlgo = pwdCipherAlgo.getValue();
// 2. set AES password cipher algorithm
pwdCipherAlgo.setValue("AES");
configurationService.update(pwdCipherAlgo.getKey(), pwdCipherAlgo);
// 3. create user with no resources
UserTO userTO = getUniqueSampleTO("syncope136_AES@apache.org");
userTO.getResources().clear();
userTO = userService.create(userTO).readEntity(UserTO.class);
assertNotNull(userTO);
// 4. update user, assign a propagation primary resource but don't provide any password
UserMod userMod = new UserMod();
userMod.setId(userTO.getId());
userMod.addResourceToBeAdded(RESOURCE_NAME_WS1);
userTO = userService.update(userMod.getId(), userMod);
assertNotNull(userTO);
// 5. verify that propagation was successful
List<PropagationStatusTO> props = userTO.getPropagationStatusTOs();
assertNotNull(props);
assertEquals(1, props.size());
PropagationStatusTO prop = props.iterator().next();
assertNotNull(prop);
assertEquals(RESOURCE_NAME_WS1, prop.getResource());
assertEquals(PropagationTaskExecStatus.SUBMITTED, prop.getStatus());
// 6. restore initial cipher algorithm
pwdCipherAlgo.setValue(origpwdCipherAlgo);
configurationService.update(pwdCipherAlgo.getKey(), pwdCipherAlgo);
}