Search in sources :

Example 56 with IdmLongRunningTaskDto

use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto in project CzechIdMng by bcvsolutions.

the class SchedulerTestUtils method createIdmLongRunningTask.

public static IdmLongRunningTaskDto createIdmLongRunningTask(IdmScheduledTaskDto taskDto, Class<? extends SchedulableTaskExecutor<Boolean>> clazz, boolean running) {
    // 
    IdmLongRunningTaskDto longRunningTask = new IdmLongRunningTaskDto();
    longRunningTask.setTaskType(clazz.getCanonicalName());
    longRunningTask.setResult(new OperationResult.Builder(running ? OperationState.RUNNING : OperationState.CREATED).build());
    longRunningTask.setInstanceId("test_instance");
    longRunningTask.setScheduledTask(taskDto.getId());
    longRunningTask.setRunning(running);
    // 
    return longRunningTask;
}
Also used : IdmLongRunningTaskDto(eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto)

Aggregations

IdmLongRunningTaskDto (eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto)56 Test (org.junit.Test)32 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)29 IdmScheduledTaskDto (eu.bcvsolutions.idm.core.scheduler.api.dto.IdmScheduledTaskDto)14 IdmProcessedTaskItemDto (eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto)13 IdmLongRunningTaskFilter (eu.bcvsolutions.idm.core.scheduler.api.dto.filter.IdmLongRunningTaskFilter)13 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)11 OperationResult (eu.bcvsolutions.idm.core.api.entity.OperationResult)10 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)9 Transactional (org.springframework.transaction.annotation.Transactional)7 LocalDate (org.joda.time.LocalDate)6 LongRunningFutureTask (eu.bcvsolutions.idm.core.scheduler.api.dto.LongRunningFutureTask)5 IdmPasswordDto (eu.bcvsolutions.idm.core.api.dto.IdmPasswordDto)4 Task (eu.bcvsolutions.idm.core.scheduler.api.dto.Task)4 UUID (java.util.UUID)4 OperationState (eu.bcvsolutions.idm.core.api.domain.OperationState)3 DefaultResultModel (eu.bcvsolutions.idm.core.api.dto.DefaultResultModel)3 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)3 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)3 ResultModel (eu.bcvsolutions.idm.core.api.dto.ResultModel)3