use of eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter in project CzechIdMng by bcvsolutions.
the class DefaultPasswordFilterManager method getActiveUniformPasswordDefinitions.
/**
* Get active uniform password definition for given system. System can be now only in
* one password definition.
* TODO: this behavior can be changed in future.
*
* @param systemDto
* @return
* @throws ResultCodeException when definition not found or uniform password definition is disabled
*/
private List<AccUniformPasswordDto> getActiveUniformPasswordDefinitions(SysSystemDto systemDto) {
AccUniformPasswordFilter filter = new AccUniformPasswordFilter();
filter.setSystemId(systemDto.getId());
filter.setDisabled(Boolean.FALSE);
List<AccUniformPasswordDto> definitions = uniformPasswordService.find(filter, null).getContent();
if (definitions.isEmpty()) {
return Lists.newArrayList();
}
return definitions;
}
use of eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter in project CzechIdMng by bcvsolutions.
the class DefaultUniformPasswordManager method getUniformPasswordBySystem.
@Override
public AccUniformPasswordDto getUniformPasswordBySystem(UUID systemId) {
Assert.notNull(systemId, "System ID cannot be null!");
AccUniformPasswordFilter uniformPasswordFilter = new AccUniformPasswordFilter();
uniformPasswordFilter.setSystemId(systemId);
uniformPasswordFilter.setDisabled(Boolean.FALSE);
return uniformPasswordService.find(uniformPasswordFilter, null).getContent().stream().findFirst().orElse(null);
}
use of eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter in project CzechIdMng by bcvsolutions.
the class DefaultAccTestHelper method cleaner.
/**
* Manual delete of all automatic roles, sync, mappings. Because previous tests didn't make a delete well.
*/
@Override
public void cleaner() {
// Delete all automatic roles.
roleTreeNodeService.deleteAll(roleTreeNodeService.find(new IdmRoleTreeNodeFilter(), null).getContent());
automaticRoleAttributeService.deleteAll(automaticRoleAttributeService.find(new IdmRoleTreeNodeFilter(), null).getContent());
// Delete all syncs.
syncConfigService.deleteAll(syncConfigService.find(new SysSyncConfigFilter(), null).getContent());
// Delete all groups.
systemGroupService.deleteAll(systemGroupService.find(new SysSystemGroupFilter(), null));
// Delete all mappings.
systemMappingService.deleteAll(systemMappingService.find(new SysSystemMappingFilter(), null).getContent());
// Delete all uniform password definitions.
uniformPasswordService.deleteAll(uniformPasswordService.find(new AccUniformPasswordFilter(), null).getContent());
}
use of eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter 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());
}
use of eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter 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());
}
Aggregations