use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class UniformPasswordSaveProcessor method process.
@Override
public EventResult<AccUniformPasswordDto> process(EntityEvent<AccUniformPasswordDto> event) {
AccUniformPasswordDto uniformPasswordDto = event.getContent();
uniformPasswordDto = unifromasswordService.saveInternal(uniformPasswordDto);
event.setContent(uniformPasswordDto);
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto 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.AccUniformPasswordDto 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());
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class DefaultAccUniformPasswordServiceTest method testFilterByDisabledWithNull.
@Test
public void testFilterByDisabledWithNull() {
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(null);
List<AccUniformPasswordSystemDto> content = uniformPasswordSystemService.find(filter, null).getContent();
assertEquals(2, content.size());
}
use of eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto in project CzechIdMng by bcvsolutions.
the class DefaultAccUniformPasswordServiceTest method testFilterSystemId.
@Test
public void testFilterSystemId() {
SysSystemDto system = createSystem(true);
SysSystemDto systemTwo = createSystem(true);
AccUniformPasswordDto uniformDefinition = createUniformDefinition(true);
assignSystem(uniformDefinition, system, systemTwo);
AccUniformPasswordDto uniformDefinitionTwo = createUniformDefinition(true);
assignSystem(uniformDefinitionTwo, systemTwo);
AccUniformPasswordFilter filter = new AccUniformPasswordFilter();
filter.setSystemId(system.getId());
List<AccUniformPasswordDto> uniform = uniformPasswordService.find(filter, null).getContent();
assertEquals(1, uniform.size());
AccUniformPasswordDto uniformPasswordDto = uniform.get(0);
assertEquals(uniformDefinition.getId(), uniformPasswordDto.getId());
}
Aggregations