use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmProcessedTaskItemDtoServiceTest method testItemTypeReference.
@Test
public void testItemTypeReference() {
IdmScheduledTaskDto d = helper.createSchedulableTask();
IdmLongRunningTaskDto lrt = this.createLongRunningTask(d);
IdmProcessedTaskItemDto item = helper.prepareProcessedItem(lrt);
//
try {
item.setScheduledTaskQueueOwner(d.getId());
service.get(service.saveInternal(item).getId());
fail("Both log and queue association is forbidden.");
} catch (CoreException e) {
assertNotNull(e.getMessage());
}
//
try {
item.setScheduledTaskQueueOwner(null);
item.setLongRunningTask(null);
service.get(service.saveInternal(item).getId());
fail("Empty log and queue association is forbidden.");
} catch (CoreException e) {
assertNotNull(e.getMessage());
}
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class HrContractExclusionProcessIntegrationTest method testEnd1.
/**
* One contract to be disabled with manually added roles attached.
* The end of contract process must disable the identity and remove
* added roles.
*/
@Test
public void testEnd1() {
IdmIdentityContractDto dto = prepareTestData1();
assertEquals(false, identityService.get(dto.getIdentity()).isDisabled());
//
process(lrt, dto);
//
Page<IdmProcessedTaskItemDto> queueItems = itemService.findQueueItems(scheduledTask, null);
Page<IdmProcessedTaskItemDto> logItems = itemService.findLogItems(lrt, null);
//
assertEquals(true, identityService.get(dto.getIdentity()).isDisabled());
assertEquals(1, queueItems.getTotalElements());
assertEquals(1, logItems.getTotalElements());
SchedulerTestUtils.checkLogItems(lrt, IdmIdentityContractDto.class, logItems);
SchedulerTestUtils.checkQueueItems(scheduledTask, IdmIdentityContractDto.class, queueItems);
identityRoleService.findAllByContract(dto.getId()).forEach(r -> assertTrue(r.isAutomaticRole()));
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class HrContractExclusionProcessIntegrationTest method testExclusionWithProcessorsEnabled.
@Test
public void testExclusionWithProcessorsEnabled() {
enableAllProcessors();
//
IdmIdentityContractDto dto = prepareTestData2();
assertEquals(false, identityService.get(dto.getIdentity()).isDisabled());
//
process(lrt, dto);
//
Page<IdmProcessedTaskItemDto> queueItems = itemService.findQueueItems(scheduledTask, null);
Page<IdmProcessedTaskItemDto> logItems = itemService.findLogItems(lrt, null);
//
assertEquals(false, identityService.get(dto.getIdentity()).isDisabled());
assertEquals(1, queueItems.getTotalElements());
assertEquals(1, logItems.getTotalElements());
SchedulerTestUtils.checkLogItems(lrt, IdmIdentityContractDto.class, logItems);
SchedulerTestUtils.checkQueueItems(scheduledTask, IdmIdentityContractDto.class, queueItems);
identityRoleService.findAllByContract(dto.getId()).forEach(r -> assertTrue(r.isAutomaticRole()));
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class HrEndContractProcessIntegrationTest method testEndWithProcessorsEnabled.
@Test
public void testEndWithProcessorsEnabled() {
enableAllProcessors();
//
IdmIdentityContractDto dto = prepareTestData2();
//
process(lrt, dto);
//
Page<IdmProcessedTaskItemDto> queueItems = itemService.findQueueItems(scheduledTask, null);
Page<IdmProcessedTaskItemDto> logItems = itemService.findLogItems(lrt, null);
//
assertEquals(false, identityService.get(dto.getIdentity()).isDisabled());
assertEquals(1, queueItems.getTotalElements());
assertEquals(1, logItems.getTotalElements());
SchedulerTestUtils.checkLogItems(lrt, IdmIdentityContractDto.class, logItems);
SchedulerTestUtils.checkQueueItems(scheduledTask, IdmIdentityContractDto.class, queueItems);
assertEquals(0, identityRoleService.findAllByContract(dto.getId()).size());
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class HrEndContractProcessIntegrationTest method testEnd2.
@Test
public void testEnd2() {
IdmIdentityContractDto dto = prepareTestData2();
assertEquals(false, identityService.get(dto.getIdentity()).isDisabled());
assertNotEquals(0, identityRoleService.findAllByContract(dto.getId()).size());
//
process(lrt, dto);
//
Page<IdmProcessedTaskItemDto> queueItems = itemService.findQueueItems(scheduledTask, null);
Page<IdmProcessedTaskItemDto> logItems = itemService.findLogItems(lrt, null);
//
assertEquals(false, identityService.get(dto.getIdentity()).isDisabled());
assertEquals(1, queueItems.getTotalElements());
assertEquals(1, logItems.getTotalElements());
SchedulerTestUtils.checkLogItems(lrt, IdmIdentityContractDto.class, logItems);
SchedulerTestUtils.checkQueueItems(scheduledTask, IdmIdentityContractDto.class, queueItems);
assertEquals(0, identityRoleService.findAllByContract(dto.getId()).size());
}
Aggregations