use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method provisioningD_UpdateAccount.
@Test
public void provisioningD_UpdateAccount() {
IdmRoleFilter filter = new IdmRoleFilter();
filter.setProperty(IdmRole_.name.getName());
filter.setValue(ROLE_NAME_TEN);
IdmRoleDto roleTen = roleService.find(filter, null).getContent().get(0);
Assert.assertNotNull(roleTen);
// Check state before provisioning
TestRoleResource ten = entityManager.find(TestRoleResource.class, ROLE_NAME_TEN);
Assert.assertNotNull(ten);
Assert.assertEquals(2, ten.getPriority());
roleTen.setPriority(10);
// Save IDM changed node (must invoke provisioning)
roleService.save(roleTen);
// Check state after provisioning
ten = entityManager.find(TestRoleResource.class, ROLE_NAME_TEN);
Assert.assertNotNull(ten);
Assert.assertEquals(10, ten.getPriority());
}
use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method provisioningF_DeleteAccount.
@Test
public void provisioningF_DeleteAccount() {
IdmRoleFilter filter = new IdmRoleFilter();
filter.setProperty(IdmRole_.name.getName());
filter.setValue(ROLE_NAME_TEN);
IdmRoleDto roleTen = roleService.find(filter, null).getContent().get(0);
Assert.assertNotNull(roleTen);
TestRoleResource ten = entityManager.find(TestRoleResource.class, ROLE_NAME_TEN);
Assert.assertNotNull(ten);
// Delete IDM role (must invoke provisioning)
roleService.delete(roleTen);
ten = entityManager.find(TestRoleResource.class, ROLE_NAME_TEN);
Assert.assertNull(ten);
}
use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method changeOne.
@Transactional
public void changeOne() {
TestRoleResource one = entityManager.find(TestRoleResource.class, "1");
one.setDescription(CHANGED);
entityManager.persist(one);
}
Aggregations