use of eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto in project CzechIdMng by bcvsolutions.
the class DefaultAccUniformPasswordServiceTest method testFindOptionsForIdentityMoreWithUniform.
@Test
public void testFindOptionsForIdentityMoreWithUniform() {
SysSystemDto system = createSystem(false);
SysSystemDto systemTwo = createSystem(false);
SysSystemDto systemThree = createSystem(false);
IdmIdentityDto identity = createIdentity(system);
assignSystem(identity, systemTwo);
assignSystem(identity, systemThree);
assignSystem(createUniformDefinition(false), system, systemTwo, systemThree);
List<AccPasswordChangeOptionDto> options = uniformPasswordService.findOptionsForPasswordChange(identity);
assertEquals(1, options.size());
AccAccountDto account = getAccount(identity, system);
AccAccountDto accountTwo = getAccount(identity, systemTwo);
AccAccountDto accountThree = getAccount(identity, systemThree);
AccPasswordChangeOptionDto option = options.get(0);
assertFalse(option.isChangeInIdm());
assertEquals(3, option.getAccounts().size());
option.getAccounts().forEach(acc -> {
UUID uuid = UUID.fromString(acc);
if (!(uuid.equals(account.getId()) || uuid.equals(accountTwo.getId()) || uuid.equals(accountThree.getId()))) {
fail();
}
});
}
use of eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto in project CzechIdMng by bcvsolutions.
the class DefaultAccUniformPasswordServiceTest method testFindOptionsForIdentityOneWithoutUniform.
@Test
public void testFindOptionsForIdentityOneWithoutUniform() {
SysSystemDto system = createSystem(false);
IdmIdentityDto identity = createIdentity(system);
List<AccPasswordChangeOptionDto> options = uniformPasswordService.findOptionsForPasswordChange(identity);
assertEquals(1, options.size());
AccPasswordChangeOptionDto option = options.get(0);
assertEquals(1, option.getAccounts().size());
String string = option.getAccounts().get(0);
AccAccountDto account = getAccount(identity, system);
assertEquals(account.getId().toString(), string);
}
Aggregations