use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto in project CzechIdMng by bcvsolutions.
the class IdentityRoleValidRequestIntegrationTest method createAndSaveIdentityRole.
private IdmIdentityRoleDto createAndSaveIdentityRole(IdmIdentityContractDto identityContract, IdmRoleDto role, LocalDate validTill, LocalDate validFrom) {
IdmIdentityRoleDto entity = new IdmIdentityRoleDto();
entity.setValidTill(validTill);
entity.setValidFrom(validFrom);
entity.setRole(role.getId());
entity.setIdentityContract(identityContract.getId());
return saveInTransaction(entity, idmIdentityRoleSerivce);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto in project CzechIdMng by bcvsolutions.
the class IdentityTransitiveEvaluatorsIntegrationTest method testReadProfile.
@Test
public void testReadProfile() {
IdmIdentityDto identity = prepareIdentityProfile();
//
try {
loginService.login(new LoginDto(identity.getUsername(), identity.getPassword()));
//
IdmIdentityDto read = identityService.get(identity.getId(), IdmBasePermission.READ);
assertEquals(identity, read);
//
List<IdmIdentityContractDto> contracts = identityContractService.find(null, IdmBasePermission.READ).getContent();
assertEquals(1, contracts.size());
IdmIdentityContractDto contract = contracts.get(0);
assertEquals(identity.getId(), contract.getIdentity());
//
List<IdmIdentityRoleDto> roles = identityRoleService.find(null, IdmBasePermission.READ).getContent();
assertEquals(1, roles.size());
assertEquals(contract.getId(), roles.get(0).getIdentityContract());
} finally {
logout();
}
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto in project CzechIdMng by bcvsolutions.
the class DtoUtilsIntegrationTest method testEmbedded.
@Test
public void testEmbedded() {
IdmIdentityRoleDto dto = new IdmIdentityRoleDto();
IdmIdentityContractDto contract = new IdmIdentityContractDto(UUID.randomUUID());
dto.getEmbedded().put(IdmIdentityRole_.identityContract.getName(), contract);
//
IdmIdentityContractDto embedded = DtoUtils.getEmbedded(dto, IdmIdentityRole_.identityContract, IdmIdentityContractDto.class);
assertEquals(contract, embedded);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto in project CzechIdMng by bcvsolutions.
the class DtoUtilsIntegrationTest method testEmbeddedWithtDefault.
@Test
public void testEmbeddedWithtDefault() {
IdmIdentityRoleDto dto = new IdmIdentityRoleDto();
//
assertNull(DtoUtils.getEmbedded(dto, IdmIdentityRole_.identityContract, IdmIdentityContractDto.class, null));
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto in project CzechIdMng by bcvsolutions.
the class DtoUtilsIntegrationTest method testEmptyEmbeddedWIthoutDefault.
@Test(expected = IllegalArgumentException.class)
public void testEmptyEmbeddedWIthoutDefault() {
IdmIdentityRoleDto dto = new IdmIdentityRoleDto();
//
DtoUtils.getEmbedded(dto, IdmIdentityRole_.identityContract, IdmIdentityContractDto.class);
}
Aggregations