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