Search in sources :

Example 11 with IdmRoleGuaranteeRoleDto

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

the class DefaultIdmRoleServiceIntegrationTest method guaranteeRoleFilterTest.

@Test
public void guaranteeRoleFilterTest() {
    IdmIdentityDto identity = getHelper().createIdentity((GuardedString) null);
    IdmIdentityDto identityOther = getHelper().createIdentity((GuardedString) null);
    IdmRoleDto role = getHelper().createRole();
    IdmRoleDto guaranteeRole = getHelper().createRole();
    IdmRoleGuaranteeRoleDto roleGuaranteeRole = new IdmRoleGuaranteeRoleDto();
    roleGuaranteeRole.setRole(role.getId());
    roleGuaranteeRole.setGuaranteeRole(guaranteeRole.getId());
    roleGuaranteeRoleService.save(roleGuaranteeRole);
    getHelper().createIdentityRole(identity, guaranteeRole);
    // 
    IdmRoleFilter filter = new IdmRoleFilter();
    filter.setGuaranteeId(identity.getId());
    Page<IdmRoleDto> result = roleService.find(filter, null);
    Assert.assertEquals("Wrong guarantee", 1, result.getTotalElements());
    Assert.assertEquals("Wrong guarantee id", role.getId(), result.getContent().get(0).getId());
    // 
    filter.setGuaranteeId(identityOther.getId());
    result = roleService.find(filter, null);
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter) IdmRoleGuaranteeRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleGuaranteeRoleDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) AbstractRestTest(eu.bcvsolutions.idm.test.api.AbstractRestTest) Test(org.junit.Test)

Example 12 with IdmRoleGuaranteeRoleDto

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

the class IdmRoleGuaranteeRoleControllerRestTest method prepareDto.

@Override
protected IdmRoleGuaranteeRoleDto prepareDto() {
    IdmRoleGuaranteeRoleDto dto = new IdmRoleGuaranteeRoleDto();
    dto.setRole(getHelper().createRole().getId());
    dto.setGuaranteeRole(getHelper().createRole().getId());
    return dto;
}
Also used : IdmRoleGuaranteeRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleGuaranteeRoleDto)

Aggregations

IdmRoleGuaranteeRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleGuaranteeRoleDto)12 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)6 Test (org.junit.Test)6 IdmRoleGuaranteeRoleFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleGuaranteeRoleFilter)4 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)3 DefaultEventResult (eu.bcvsolutions.idm.core.api.event.DefaultEventResult)2 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)2 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)2 AbstractRestTest (eu.bcvsolutions.idm.test.api.AbstractRestTest)2 UUID (java.util.UUID)2 BaseDto (eu.bcvsolutions.idm.core.api.dto.BaseDto)1 IdmExportImportDto (eu.bcvsolutions.idm.core.api.dto.IdmExportImportDto)1 IdmRoleFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter)1 IdmRoleGuaranteeFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleGuaranteeFilter)1 IdmRoleGuaranteeRoleService (eu.bcvsolutions.idm.core.api.service.IdmRoleGuaranteeRoleService)1 IdmRoleService (eu.bcvsolutions.idm.core.api.service.IdmRoleService)1 CoreGroupPermission (eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission)1 IdmRoleGuaranteeRole (eu.bcvsolutions.idm.core.model.entity.IdmRoleGuaranteeRole)1 IdmBasePermission (eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission)1 AbstractEvaluatorIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractEvaluatorIntegrationTest)1