use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class DefaultAccUniformPasswordServiceTest method testFilterByCode.
@Test
public void testFilterByCode() {
createUniformDefinition(true);
AccUniformPasswordDto uniformDefinitionTwo = createUniformDefinition(true);
createUniformDefinition(true);
AccUniformPasswordFilter filter = new AccUniformPasswordFilter();
filter.setCodeableIdentifier(uniformDefinitionTwo.getCode());
List<AccUniformPasswordDto> uniform = uniformPasswordService.find(filter, null).getContent();
assertEquals(1, uniform.size());
AccUniformPasswordDto uniformPasswordDto = uniform.get(0);
assertEquals(uniformDefinitionTwo.getId(), uniformPasswordDto.getId());
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class DefaultPasswordFilterManagerIntegrationTest method testUTF8CharactersUsername.
@Test
public void testUTF8CharactersUsername() {
SysSystemDto system = createSystem(false);
SysSystemDto systemTwo = createSystem(false);
IdmIdentityDto identity = createIdentity(system);
identity.setUsername("+ěščřžýáíé=)ů§.-ǒǐďǚǎǧȟǰǩľě😊⌛");
identity = identityService.save(identity);
String password = getHelper().createName();
PasswordRequest request = prepareRequest(identity.getUsername(), system.getCode(), password);
AccUniformPasswordDto uniformDefinition = createUniformDefinition(true);
assignSystem(uniformDefinition, system, systemTwo);
assignSystem(identity, systemTwo);
setPasswordFilter(system, true);
setPasswordFilter(systemTwo, true);
checkEcho(identity, system, EchoCheck.DOESNT_EXIST);
checkEcho(identity, systemTwo, EchoCheck.DOESNT_EXIST);
processValidate(request, true);
checkEcho(identity, system, EchoCheck.VALIDATE);
checkEcho(identity, systemTwo, EchoCheck.VALIDATE);
checkPassword(prepareUid(identity, system), password, false);
processChange(request, true);
checkEcho(identity, system, EchoCheck.VALIDATE_AND_CHANGE);
checkEcho(identity, systemTwo, EchoCheck.VALIDATE_AND_CHANGE);
// Password will not be same!
checkPassword(prepareUid(identity, system), password, false);
checkPassword(prepareUid(identity, systemTwo), password, true);
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class DefaultPasswordFilterManagerIntegrationTest method testMoreSystemsUniformPasswordSystem.
@Test
public void testMoreSystemsUniformPasswordSystem() {
SysSystemDto systemOne = createSystem(false);
IdmIdentityDto identity = createIdentity(systemOne);
setPasswordFilter(systemOne, true);
List<SysSystemDto> systems = Lists.newArrayList(systemOne);
AccUniformPasswordDto uniformPasswordDto = createUniformDefinition(false);
assignSystem(uniformPasswordDto, systemOne);
for (int index = 0; index < 11; index++) {
SysSystemDto system = createSystem(false);
assignSystem(identity, system);
setPasswordFilter(system, true);
assignSystem(uniformPasswordDto, system);
systems.add(system);
}
String password = getHelper().createName();
PasswordRequest request = prepareRequest(identity.getUsername(), systemOne.getCode(), password);
systems.forEach(s -> {
checkEcho(identity, s, EchoCheck.DOESNT_EXIST);
});
processValidate(request, true);
systems.forEach(s -> {
checkEcho(identity, s, EchoCheck.VALIDATE);
checkPassword(prepareUid(identity, systemOne), password, false);
});
processChange(request, true);
systems.forEach(s -> {
checkEcho(identity, s, EchoCheck.VALIDATE_AND_CHANGE);
if (!s.getId().equals(systemOne.getId())) {
checkPassword(prepareUid(identity, systemOne), password, false);
} else {
checkPassword(prepareUid(identity, s), password, false);
}
});
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class DefaultPasswordFilterManagerIntegrationTest method testUTF8CharactersPassword.
@Test
public void testUTF8CharactersPassword() {
SysSystemDto system = createSystem(false);
SysSystemDto systemTwo = createSystem(false);
IdmIdentityDto identity = createIdentity(system);
String password = "+ěščřžýáíé=)ů§.-ǒǐďǚǎǧȟǰǩľě😊⌛";
PasswordRequest request = prepareRequest(identity.getUsername(), system.getCode(), password);
AccUniformPasswordDto uniformDefinition = createUniformDefinition(true);
assignSystem(uniformDefinition, system, systemTwo);
assignSystem(identity, systemTwo);
setPasswordFilter(system, true);
setPasswordFilter(systemTwo, true);
checkEcho(identity, system, EchoCheck.DOESNT_EXIST);
checkEcho(identity, systemTwo, EchoCheck.DOESNT_EXIST);
processValidate(request, true);
checkEcho(identity, system, EchoCheck.VALIDATE);
checkEcho(identity, systemTwo, EchoCheck.VALIDATE);
checkPassword(prepareUid(identity, system), password, false);
processChange(request, true);
checkEcho(identity, system, EchoCheck.VALIDATE_AND_CHANGE);
checkEcho(identity, systemTwo, EchoCheck.VALIDATE_AND_CHANGE);
// Password will not be same!
checkPassword(prepareUid(identity, system), password, false);
checkPassword(prepareUid(identity, systemTwo), password, true);
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class AbstractPasswordFilterIntegrationTest method createUniformDefinition.
protected AccUniformPasswordDto createUniformDefinition(boolean changeInIdm) {
AccUniformPasswordDto dto = new AccUniformPasswordDto();
dto.setCode(getHelper().createName());
dto.setChangeInIdm(changeInIdm);
return uniformPasswordService.save(dto);
}
Aggregations