Search in sources :

Example 1 with AccUniformPasswordSystemDto

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;
}
Also used : AccUniformPasswordDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto) AccUniformPasswordSystemDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto)

Example 2 with AccUniformPasswordSystemDto

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);
}
Also used : DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) AccUniformPasswordSystemDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto)

Example 3 with AccUniformPasswordSystemDto

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);
    }
}
Also used : AccUniformPasswordSystemDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto)

Example 4 with AccUniformPasswordSystemDto

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());
}
Also used : AccUniformPasswordSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordSystemFilter) AccUniformPasswordDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto) AccUniformPasswordSystemDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractPasswordFilterIntegrationTest(eu.bcvsolutions.idm.acc.AbstractPasswordFilterIntegrationTest)

Example 5 with AccUniformPasswordSystemDto

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());
}
Also used : AccUniformPasswordSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordSystemFilter) AccUniformPasswordDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto) AccUniformPasswordSystemDto(eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractPasswordFilterIntegrationTest(eu.bcvsolutions.idm.acc.AbstractPasswordFilterIntegrationTest)

Aggregations

AccUniformPasswordSystemDto (eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto)9 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)7 AccUniformPasswordDto (eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto)6 AccUniformPasswordSystemFilter (eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordSystemFilter)5 AbstractPasswordFilterIntegrationTest (eu.bcvsolutions.idm.acc.AbstractPasswordFilterIntegrationTest)4 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)4 Test (org.junit.Test)4 DefaultEventResult (eu.bcvsolutions.idm.core.api.event.DefaultEventResult)2 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 AccGroupPermission (eu.bcvsolutions.idm.acc.domain.AccGroupPermission)1 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)1 AccPasswordChangeOptionDto (eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto)1 AccAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccAccountFilter)1 AccUniformPasswordFilter (eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter)1 AccAccount_ (eu.bcvsolutions.idm.acc.entity.AccAccount_)1 AccUniformPassword (eu.bcvsolutions.idm.acc.entity.AccUniformPassword)1 AccUniformPasswordSystem_ (eu.bcvsolutions.idm.acc.entity.AccUniformPasswordSystem_)1 AccUniformPassword_ (eu.bcvsolutions.idm.acc.entity.AccUniformPassword_)1 AccUniformPasswordRepository (eu.bcvsolutions.idm.acc.repository.AccUniformPasswordRepository)1