Search in sources :

Example 76 with IdmEntityStateDto

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;
}
Also used : IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto)

Example 77 with IdmEntityStateDto

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));
}
Also used : IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) IdmLongRunningTaskDto(eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) IdmProcessedTaskItemFilter(eu.bcvsolutions.idm.core.scheduler.api.dto.filter.IdmProcessedTaskItemFilter) IdmProcessedTaskItemDto(eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

IdmEntityStateDto (eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto)77 OperationResultDto (eu.bcvsolutions.idm.core.api.dto.OperationResultDto)43 Test (org.junit.Test)41 UUID (java.util.UUID)40 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)33 DefaultResultModel (eu.bcvsolutions.idm.core.api.dto.DefaultResultModel)30 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)30 OperationState (eu.bcvsolutions.idm.core.api.domain.OperationState)24 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)23 List (java.util.List)21 Autowired (org.springframework.beans.factory.annotation.Autowired)21 IdmEntityEventDto (eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto)20 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)19 Transactional (org.springframework.transaction.annotation.Transactional)19 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)18 Lists (com.google.common.collect.Lists)15 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)15 DefaultEventResult (eu.bcvsolutions.idm.core.api.event.DefaultEventResult)15 Assert (org.junit.Assert)14 CoreResultCode (eu.bcvsolutions.idm.core.api.domain.CoreResultCode)13