use of eu.bcvsolutions.idm.core.scheduler.api.dto.filter.IdmProcessedTaskItemFilter in project CzechIdMng by bcvsolutions.
the class DefaultIdmProcessedTaskItemDtoServiceTest method getLongRunningTaskIdFilter.
@Test
public void getLongRunningTaskIdFilter() {
IdmScheduledTaskDto d = helper.createSchedulableTask();
IdmLongRunningTaskDto lrt = this.createLongRunningTask(d);
IdmLongRunningTaskDto lrt2 = this.createLongRunningTask(d);
//
IdmProcessedTaskItemDto item = service.saveInternal(helper.prepareProcessedItem(lrt));
IdmProcessedTaskItemDto item2 = service.saveInternal(helper.prepareProcessedItem(lrt));
IdmProcessedTaskItemDto item3 = service.saveInternal(helper.prepareProcessedItem(lrt2));
//
IdmProcessedTaskItemFilter filter = new IdmProcessedTaskItemFilter();
filter.setLongRunningTaskId(lrt.getId());
Page<IdmProcessedTaskItemDto> result = service.find(filter, null);
assertEquals("Wrong number of items!", 2, result.getTotalElements());
assertTrue(result.getContent().contains(item));
assertTrue(result.getContent().contains(item2));
assertFalse(result.getContent().contains(item3));
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.filter.IdmProcessedTaskItemFilter in project CzechIdMng by bcvsolutions.
the class DefaultIdmProcessedTaskItemDtoServiceTest method scheduledTaskIdFilter.
@Test
public void scheduledTaskIdFilter() {
IdmScheduledTaskDto d = helper.createSchedulableTask();
IdmProcessedTaskItemDto item = service.saveInternal(helper.prepareProcessedItem(d));
IdmProcessedTaskItemDto item2 = service.saveInternal(helper.prepareProcessedItem(d));
//
IdmProcessedTaskItemFilter filter = new IdmProcessedTaskItemFilter();
filter.setScheduledTaskId(d.getId());
Page<IdmProcessedTaskItemDto> result = service.find(filter, null);
assertEquals("Wrong number of items!", 2, result.getTotalElements());
assertTrue(result.getContent().contains(item));
assertTrue(result.getContent().contains(item2));
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.filter.IdmProcessedTaskItemFilter in project CzechIdMng by bcvsolutions.
the class DefaultIdmProcessedTaskItemDtoServiceTest method getOperationState.
@Test
public void getOperationState() {
IdmScheduledTaskDto d = helper.createSchedulableTask();
//
IdmProcessedTaskItemDto item = service.saveInternal(helper.prepareProcessedItem(d));
IdmProcessedTaskItemDto item2 = service.saveInternal(helper.prepareProcessedItem(d));
IdmProcessedTaskItemDto item3 = service.saveInternal(helper.prepareProcessedItem(d, OperationState.CANCELED));
//
IdmProcessedTaskItemFilter filter = new IdmProcessedTaskItemFilter();
filter.setOperationState(item.getOperationResult().getState());
Page<IdmProcessedTaskItemDto> result = service.find(filter, null);
assertTrue(result.getContent().contains(item));
assertTrue(result.getContent().contains(item2));
assertFalse(result.getContent().contains(item3));
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.filter.IdmProcessedTaskItemFilter in project CzechIdMng by bcvsolutions.
the class DefaultIdmProcessedTaskItemDtoServiceTest method referencedEntityIdFilter.
@Test
public void referencedEntityIdFilter() {
IdmScheduledTaskDto d = helper.createSchedulableTask();
IdmProcessedTaskItemDto item = service.saveInternal(helper.prepareProcessedItem(d));
IdmProcessedTaskItemDto item2 = service.saveInternal(helper.prepareProcessedItem(d));
//
IdmProcessedTaskItemFilter filter = new IdmProcessedTaskItemFilter();
filter.setReferencedEntityId(item.getReferencedEntityId());
Page<IdmProcessedTaskItemDto> result = service.find(filter, null);
assertEquals("Wrong number of items!", 1, result.getTotalElements());
assertTrue(result.getContent().contains(item));
assertFalse(result.getContent().contains(item2));
//
filter.setReferencedEntityId(item2.getReferencedEntityId());
result = service.find(filter, null);
assertEquals("Wrong number of items!", 1, result.getTotalElements());
assertTrue(result.getContent().contains(item2));
assertFalse(result.getContent().contains(item));
}
Aggregations