use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method provisioningD_UpdateAccount_Extended_Attribute.
@Test
public void provisioningD_UpdateAccount_Extended_Attribute() {
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);
Assert.assertTrue(formService.getValues(roleTen.getId(), IdmRole.class, "changed").isEmpty());
// Check state before provisioning
TestRoleResource ten = entityManager.find(TestRoleResource.class, ROLE_NAME_TEN);
Assert.assertNotNull(ten);
Assert.assertEquals(null, ten.getModified());
// Create extended attribute
LocalDateTime now = LocalDateTime.now();
formService.saveValues(roleTen.getId(), IdmRole.class, "changed", ImmutableList.of(now.toString(DATE_TABLE_CONNECTOR_FORMAT)));
// 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(now.toString(DATE_TABLE_CONNECTOR_FORMAT), ten.getModified().toString(DATE_TABLE_CONNECTOR_FORMAT));
}
use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method createRole.
private TestRoleResource createRole(String code, String type, LocalDateTime changed, int priority) {
TestRoleResource role = new TestRoleResource();
role.setType(type);
role.setName(code);
role.setPriority(priority);
role.setModified(changed);
role.setDescription(code);
return role;
}
use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method provisioningA_CreateAccount_withOutMapping.
@Test
@Transactional
public void provisioningA_CreateAccount_withOutMapping() {
// Delete all resource data
this.deleteAllResourceData();
// Create role in IDM tree
IdmRoleDto roleTen = new IdmRoleDto();
roleTen.setName(ROLE_NAME_TEN);
roleTen.setPriority(2);
roleTen = roleService.save(roleTen);
// Check state before provisioning
TestRoleResource one = entityManager.find(TestRoleResource.class, ROLE_NAME_TEN);
Assert.assertNull(one);
}
use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method provisioningB_CreateAccounts.
@Test
public void provisioningB_CreateAccounts() {
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.assertNull(ten);
// Create mapping for provisioning
this.createProvisionigMapping();
// Save IDM role (must invoke provisioning)
roleService.save(roleTen);
// Check state before provisioning
ten = entityManager.find(TestRoleResource.class, ROLE_NAME_TEN);
Assert.assertNotNull(ten);
}
use of eu.bcvsolutions.idm.acc.entity.TestRoleResource in project CzechIdMng by bcvsolutions.
the class DefaultRoleSynchronizationServiceTest method removeOne.
@Transactional
public void removeOne() {
TestRoleResource one = entityManager.find(TestRoleResource.class, "1");
entityManager.remove(one);
}
Aggregations