Search in sources :

Example 6 with TestRoleResource

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());
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter) TestRoleResource(eu.bcvsolutions.idm.acc.entity.TestRoleResource) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 7 with TestRoleResource

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);
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter) TestRoleResource(eu.bcvsolutions.idm.acc.entity.TestRoleResource) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 8 with TestRoleResource

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);
}
Also used : TestRoleResource(eu.bcvsolutions.idm.acc.entity.TestRoleResource) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

TestRoleResource (eu.bcvsolutions.idm.acc.entity.TestRoleResource)8 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)5 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)5 Test (org.junit.Test)5 IdmRoleFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter)4 Transactional (org.springframework.transaction.annotation.Transactional)3 LocalDateTime (org.joda.time.LocalDateTime)1