use of eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto in project CzechIdMng by bcvsolutions.
the class IdmEntityStateControllerRestTest method prepareDto.
@Override
protected IdmEntityStateDto prepareDto() {
IdmEntityStateDto dto = new IdmEntityStateDto();
dto.setOwnerId(UUID.randomUUID());
dto.setOwnerType("mock");
dto.setInstanceId("mock");
dto.setResult(new OperationResultDto(OperationState.CREATED));
return dto;
}
use of eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmProcessedTaskItemServiceTest method filterByIgnoredMonitoringOfRelatedTask.
@Test
public void filterByIgnoredMonitoringOfRelatedTask() {
IdmLongRunningTaskDto ignoredTask = getHelper().createLongRunningTask(new TestSchedulableTask());
IdmEntityStateDto state = new IdmEntityStateDto();
state.setResult(new OperationResultDto.Builder(OperationState.BLOCKED).setModel(new DefaultResultModel(CoreResultCode.MONITORING_IGNORED)).build());
entityStateManager.saveState(ignoredTask, state);
IdmLongRunningTaskDto unignoredTask = getHelper().createLongRunningTask(new TestSchedulableTask());
//
IdmProcessedTaskItemDto item = service.saveInternal(getHelper().prepareProcessedItem(ignoredTask));
IdmProcessedTaskItemDto item2 = service.saveInternal(getHelper().prepareProcessedItem(ignoredTask));
IdmProcessedTaskItemDto item3 = service.saveInternal(getHelper().prepareProcessedItem(unignoredTask));
//
IdmProcessedTaskItemFilter filter = new IdmProcessedTaskItemFilter();
filter.setTaskMonitoringIgnored(true);
Page<IdmProcessedTaskItemDto> result = service.find(filter, null);
assertTrue(result.getContent().contains(item));
assertTrue(result.getContent().contains(item2));
assertFalse(result.getContent().contains(item3));
}
Aggregations