Search in sources :

Example 6 with AccUniformPasswordDto

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

Example 7 with AccUniformPasswordDto

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());
}
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 8 with AccUniformPasswordDto

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());
}
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)

Example 9 with AccUniformPasswordDto

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());
}
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)

Example 10 with AccUniformPasswordDto

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

Aggregations

AccUniformPasswordDto (eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto)22 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)15 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)13 Test (org.junit.Test)12 AbstractPasswordFilterIntegrationTest (eu.bcvsolutions.idm.acc.AbstractPasswordFilterIntegrationTest)8 AccUniformPasswordSystemDto (eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto)6 AccUniformPasswordFilter (eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter)6 AccUniformPasswordSystemFilter (eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordSystemFilter)6 UUID (java.util.UUID)6 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)5 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)4 AccAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccAccountFilter)4 Lists (com.google.common.collect.Lists)3 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)3 SysSyncContractConfigDto (eu.bcvsolutions.idm.acc.dto.SysSyncContractConfigDto)3 SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)3 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)3 AccAccount_ (eu.bcvsolutions.idm.acc.entity.AccAccount_)3 TestContractResource (eu.bcvsolutions.idm.acc.entity.TestContractResource)3 TestResource (eu.bcvsolutions.idm.acc.entity.TestResource)3