use of eu.bcvsolutions.idm.core.api.domain.RoleType in project CzechIdMng by bcvsolutions.
the class IdmRoleController method toFilter.
@Override
protected IdmRoleFilter toFilter(MultiValueMap<String, Object> parameters) {
IdmRoleFilter filter = new IdmRoleFilter(parameters);
filter.setText(getParameterConverter().toString(parameters, "text"));
filter.setRoleType(getParameterConverter().toEnum(parameters, "roleType", RoleType.class));
filter.setRoleCatalogueId(getParameterConverter().toUuid(parameters, "roleCatalogue"));
filter.setGuaranteeId(getParameterConverter().toEntityUuid(parameters, "guarantee", IdmIdentity.class));
return filter;
}
use of eu.bcvsolutions.idm.core.api.domain.RoleType in project CzechIdMng by bcvsolutions.
the class DefaultIdmRoleServiceIntegrationTest method typeFilterTest.
@Test
public void typeFilterTest() {
IdmRoleDto role = helper.createRole();
IdmRoleDto role2 = helper.createRole();
IdmRoleDto role3 = helper.createRole();
RoleType type = RoleType.LOGIN;
RoleType type2 = RoleType.BUSINESS;
role = roleService.get(role.getId());
role.setRoleType(type);
role = roleService.save(role);
role2 = roleService.get(role2.getId());
role2.setRoleType(type);
role2 = roleService.save(role2);
role3 = roleService.get(role3.getId());
role3.setRoleType(type2);
role3 = roleService.save(role3);
IdmRoleFilter filter = new IdmRoleFilter();
filter.setRoleType(type);
Page<IdmRoleDto> result = roleService.find(filter, null);
assertEquals("Wrong type #1", 2, result.getTotalElements());
assertTrue("Wrong type #1 contains", result.getContent().contains(role));
filter.setRoleType(type2);
result = roleService.find(filter, null);
assertEquals("Wrong type #2", 1, result.getTotalElements());
assertTrue("Wrong type #2 contains", result.getContent().contains(role3));
}
Aggregations