use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto in project CzechIdMng by bcvsolutions.
the class HrContractExclusionProcessIntegrationTest method testExclusion3.
@Test
public void testExclusion3() {
IdmIdentityContractDto dto = prepareTestData3();
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);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto in project CzechIdMng by bcvsolutions.
the class HrEnableContractProcessIntegrationTest method testEnable2.
/**
* Disabled identity, two contracts, one gets enabled => must enable identity.
*/
@Test
public void testEnable2() {
IdmIdentityContractDto dto = prepareTestData2();
assertEquals(true, 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);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto in project CzechIdMng by bcvsolutions.
the class HrEnableContractProcessIntegrationTest method testEnableWithEnabledProcessor.
@Test
public void testEnableWithEnabledProcessor() {
helper.enable(IdentityContractEnableProcessor.class);
//
IdmIdentityContractDto dto = prepareTestData1();
// identity is enabled by processor
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);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto in project CzechIdMng by bcvsolutions.
the class HrEnableContractProcessIntegrationTest method testGetItemsToProcessAddValidContracts.
@Test
public void testGetItemsToProcessAddValidContracts() {
final long originalCount = executor.getItemsToProcess(null).getTotalElements();
//
IdmIdentityContractDto contract = getTestContract(createTestIdentity(UUID.randomUUID().toString()), false);
contract.setValidTill(LocalDate.now().plusDays(1));
contract = identityContractService.save(contract);
assertTrue(contract.isValid());
//
long currentCount = executor.getItemsToProcess(null).getTotalElements();
//
assertEquals(originalCount + 1, currentCount);
//
contract.setValidTill(null);
contract.setValidFrom(LocalDate.now().minusDays(10));
contract = identityContractService.save(contract);
assertTrue(contract.isValid());
//
currentCount = executor.getItemsToProcess(null).getTotalElements();
//
assertEquals(originalCount + 1, currentCount);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto in project CzechIdMng by bcvsolutions.
the class HrEnableContractProcessIntegrationTest method testEnable1.
/**
* Disabled identity, one contract gets enabled => must enable identity.
*/
@Test
public void testEnable1() {
IdmIdentityContractDto dto = prepareTestData1();
assertEquals(true, 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);
}
Aggregations