Search in sources :

Example 6 with AccPasswordChangeOptionDto

use of eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto in project CzechIdMng by bcvsolutions.

the class DefaultAccUniformPasswordServiceTest method testFindOptionsForIdentityMoreWithUniform.

@Test
public void testFindOptionsForIdentityMoreWithUniform() {
    SysSystemDto system = createSystem(false);
    SysSystemDto systemTwo = createSystem(false);
    SysSystemDto systemThree = createSystem(false);
    IdmIdentityDto identity = createIdentity(system);
    assignSystem(identity, systemTwo);
    assignSystem(identity, systemThree);
    assignSystem(createUniformDefinition(false), system, systemTwo, systemThree);
    List<AccPasswordChangeOptionDto> options = uniformPasswordService.findOptionsForPasswordChange(identity);
    assertEquals(1, options.size());
    AccAccountDto account = getAccount(identity, system);
    AccAccountDto accountTwo = getAccount(identity, systemTwo);
    AccAccountDto accountThree = getAccount(identity, systemThree);
    AccPasswordChangeOptionDto option = options.get(0);
    assertFalse(option.isChangeInIdm());
    assertEquals(3, option.getAccounts().size());
    option.getAccounts().forEach(acc -> {
        UUID uuid = UUID.fromString(acc);
        if (!(uuid.equals(account.getId()) || uuid.equals(accountTwo.getId()) || uuid.equals(accountThree.getId()))) {
            fail();
        }
    });
}
Also used : AccPasswordChangeOptionDto(eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto) AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) UUID(java.util.UUID) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractPasswordFilterIntegrationTest(eu.bcvsolutions.idm.acc.AbstractPasswordFilterIntegrationTest)

Example 7 with AccPasswordChangeOptionDto

use of eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto in project CzechIdMng by bcvsolutions.

the class DefaultAccUniformPasswordServiceTest method testFindOptionsForIdentityOneWithoutUniform.

@Test
public void testFindOptionsForIdentityOneWithoutUniform() {
    SysSystemDto system = createSystem(false);
    IdmIdentityDto identity = createIdentity(system);
    List<AccPasswordChangeOptionDto> options = uniformPasswordService.findOptionsForPasswordChange(identity);
    assertEquals(1, options.size());
    AccPasswordChangeOptionDto option = options.get(0);
    assertEquals(1, option.getAccounts().size());
    String string = option.getAccounts().get(0);
    AccAccountDto account = getAccount(identity, system);
    assertEquals(account.getId().toString(), string);
}
Also used : AccPasswordChangeOptionDto(eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto) AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) 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

AccPasswordChangeOptionDto (eu.bcvsolutions.idm.acc.dto.AccPasswordChangeOptionDto)7 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)7 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)6 AbstractPasswordFilterIntegrationTest (eu.bcvsolutions.idm.acc.AbstractPasswordFilterIntegrationTest)5 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)5 Test (org.junit.Test)5 UUID (java.util.UUID)3 AccAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccAccountFilter)2 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 AccGroupPermission (eu.bcvsolutions.idm.acc.domain.AccGroupPermission)1 AccUniformPasswordDto (eu.bcvsolutions.idm.acc.dto.AccUniformPasswordDto)1 AccUniformPasswordSystemDto (eu.bcvsolutions.idm.acc.dto.AccUniformPasswordSystemDto)1 AccUniformPasswordFilter (eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordFilter)1 AccUniformPasswordSystemFilter (eu.bcvsolutions.idm.acc.dto.filter.AccUniformPasswordSystemFilter)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