use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultUniformPasswordManagerIntegrationTest method createUniformPasswordDef.
private AccUniformPasswordDto createUniformPasswordDef(SysSystemDto... systems) {
// Create uniform password definition.
AccUniformPasswordDto uniformPasswordDto = new AccUniformPasswordDto();
uniformPasswordDto.setCode(helper.createName());
uniformPasswordDto.setChangeInIdm(false);
uniformPasswordDto.setDisabled(false);
uniformPasswordDto = uniformPasswordService.save(uniformPasswordDto);
for (SysSystemDto system : systems) {
AccUniformPasswordSystemDto uniformPasswordSystemDto = new AccUniformPasswordSystemDto();
uniformPasswordSystemDto.setUniformPassword(uniformPasswordDto.getId());
uniformPasswordSystemDto.setSystem(system.getId());
uniformPasswordSystemService.save(uniformPasswordSystemDto);
}
return uniformPasswordDto;
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto in project CzechIdMng by bcvsolutions.
the class UniformPasswordSystemDeleteProcessor method process.
@Override
public EventResult<AccUniformPasswordSystemDto> process(EntityEvent<AccUniformPasswordSystemDto> event) {
AccUniformPasswordSystemDto dto = event.getContent();
uniformPasswordSystemService.deleteInternal(dto);
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto in project CzechIdMng by bcvsolutions.
the class AbstractPasswordFilterIntegrationTest method assignSystem.
protected void assignSystem(AccUniformPasswordDto uniform, SysSystemDto... systems) {
for (SysSystemDto system : systems) {
AccUniformPasswordSystemDto uniformSystem = new AccUniformPasswordSystemDto();
uniformSystem.setSystem(system.getId());
uniformSystem.setUniformPassword(uniform.getId());
uniformPasswordSystemService.save(uniformSystem);
}
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultAccUniformPasswordServiceTest method testFilterUniformSystemSystemId.
@Test
public void testFilterUniformSystemSystemId() {
SysSystemDto system = createSystem(true);
SysSystemDto systemTwo = createSystem(true);
AccUniformPasswordDto uniformDefinition = createUniformDefinition(true);
assignSystem(uniformDefinition, system, systemTwo);
AccUniformPasswordDto uniformDefinitionTwo = createUniformDefinition(true);
assignSystem(uniformDefinitionTwo, systemTwo);
AccUniformPasswordSystemFilter filter = new AccUniformPasswordSystemFilter();
filter.setSystemId(system.getId());
List<AccUniformPasswordSystemDto> content = uniformPasswordSystemService.find(filter, null).getContent();
assertEquals(1, content.size());
filter.setSystemId(systemTwo.getId());
content = uniformPasswordSystemService.find(filter, null).getContent();
assertEquals(2, content.size());
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultAccUniformPasswordServiceTest method testFilterByDisabledWithFalse.
@Test
public void testFilterByDisabledWithFalse() {
SysSystemDto system = createSystem(false);
SysSystemDto systemTwo = createSystem(false);
SysSystemDto systemThree = createSystem(false);
IdmIdentityDto identity = createIdentity(system);
assignSystem(identity, systemTwo);
assignSystem(identity, systemThree);
AccUniformPasswordDto createUniformDefinition = createUniformDefinition(true);
createUniformDefinition.setDisabled(true);
createUniformDefinition = uniformPasswordService.save(createUniformDefinition);
AccUniformPasswordDto createUniformDefinitionSecond = createUniformDefinition(true);
assignSystem(createUniformDefinitionSecond, system, systemTwo, systemThree);
assignSystem(createUniformDefinition, systemTwo);
assignSystem(createUniformDefinition(true), system);
AccUniformPasswordSystemFilter filter = new AccUniformPasswordSystemFilter();
filter.setSystemId(systemTwo.getId());
filter.setUniformPasswordDisabled(false);
List<AccUniformPasswordSystemDto> content = uniformPasswordSystemService.find(filter, null).getContent();
assertEquals(1, content.size());
AccUniformPasswordSystemDto accUniformPasswordSystemDto = content.get(0);
assertEquals(createUniformDefinitionSecond.getId(), accUniformPasswordSystemDto.getUniformPassword());
}
Aggregations