Search in sources :

Example 36 with IdmFormProjectionDto

use of eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto in project CzechIdMng by bcvsolutions.

the class DefaultIdmIdentityServiceIntegrationTest method testChangeProjectionWithoutCheckPermissions.

@Test
@Transactional
public void testChangeProjectionWithoutCheckPermissions() {
    // 
    IdmIdentityDto identity = getHelper().createIdentity();
    IdmFormProjectionDto projection = new IdmFormProjectionDto();
    projection.setCode(getHelper().createName());
    projection.setOwnerType(lookupService.getOwnerType(IdmIdentityDto.class));
    projection = projectionService.save(projection);
    // 
    IdmRoleDto role = getHelper().createRole();
    getHelper().createBasePolicy(role.getId(), CoreGroupPermission.IDENTITY, IdmIdentity.class, IdmBasePermission.UPDATE);
    getHelper().createIdentityRole(identity, role);
    // 
    try {
        getHelper().login(identity);
        identity.setFormProjection(projection.getId());
        identity = identityService.save(identity);
        Assert.assertEquals(projection.getId(), identity.getFormProjection());
    } finally {
        logout();
    }
}
Also used : IdmFormProjectionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IdmFormProjectionDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto)36 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)30 Test (org.junit.Test)21 IdmIdentityProjectionDto (eu.bcvsolutions.idm.core.api.dto.projection.IdmIdentityProjectionDto)17 Transactional (org.springframework.transaction.annotation.Transactional)16 IdmFormAttributeDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto)13 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)12 IdentityProjectionEvent (eu.bcvsolutions.idm.core.eav.api.event.IdentityProjectionEvent)12 AbstractRestTest (eu.bcvsolutions.idm.test.api.AbstractRestTest)12 IdmFormValueDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto)11 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)10 IdmFormDefinitionDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto)10 IdmFormInstanceDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto)8 IdmIdentity (eu.bcvsolutions.idm.core.model.entity.IdmIdentity)6 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)6 IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 UUID (java.util.UUID)4 ConfigurationMap (eu.bcvsolutions.idm.core.api.domain.ConfigurationMap)3