Search in sources :

Example 11 with TaskSummary

use of com.netflix.conductor.common.run.TaskSummary in project conductor by Netflix.

the class TestElasticSearchRestDAOV6 method shouldIndexTask.

@Test
public void shouldIndexTask() {
    Workflow workflow = TestUtils.loadWorkflowSnapshot("workflow");
    Task task = workflow.getTasks().get(0);
    TaskSummary summary = new TaskSummary(task);
    indexDAO.indexTask(task);
    List<String> tasks = tryFindResults(() -> searchTasks(workflow));
    assertEquals(summary.getTaskId(), tasks.get(0));
}
Also used : Task(com.netflix.conductor.common.metadata.tasks.Task) TaskSummary(com.netflix.conductor.common.run.TaskSummary) Workflow(com.netflix.conductor.common.run.Workflow) Test(org.junit.Test)

Example 12 with TaskSummary

use of com.netflix.conductor.common.run.TaskSummary in project conductor by Netflix.

the class TestElasticSearchDAOV6 method shouldIndexTask.

@Test
public void shouldIndexTask() {
    Workflow workflow = TestUtils.loadWorkflowSnapshot("workflow");
    Task task = workflow.getTasks().get(0);
    TaskSummary summary = new TaskSummary(task);
    indexDAO.indexTask(task);
    List<String> tasks = tryFindResults(() -> searchTasks(workflow));
    assertEquals(summary.getTaskId(), tasks.get(0));
}
Also used : Task(com.netflix.conductor.common.metadata.tasks.Task) TaskSummary(com.netflix.conductor.common.run.TaskSummary) Workflow(com.netflix.conductor.common.run.Workflow) Test(org.junit.Test)

Example 13 with TaskSummary

use of com.netflix.conductor.common.run.TaskSummary in project conductor by Netflix.

the class TaskResourceTest method search.

@Test
public void search() {
    Task task = new Task();
    task.setTaskType("SIMPLE");
    task.setWorkerId("123");
    task.setDomain("test");
    task.setStatus(Task.Status.IN_PROGRESS);
    TaskSummary taskSummary = new TaskSummary(task);
    ArrayList<TaskSummary> listOfTaskSummary = new ArrayList<TaskSummary>() {

        {
            add(taskSummary);
        }
    };
    SearchResult<TaskSummary> searchResult = new SearchResult<TaskSummary>(100, listOfTaskSummary);
    listOfTaskSummary.add(taskSummary);
    when(mockTaskService.search(anyInt(), anyInt(), anyString(), anyString(), anyString())).thenReturn(searchResult);
    assertEquals(searchResult, taskResource.search(0, 100, "asc", "*", "*"));
}
Also used : Task(com.netflix.conductor.common.metadata.tasks.Task) TaskSummary(com.netflix.conductor.common.run.TaskSummary) ArrayList(java.util.ArrayList) SearchResult(com.netflix.conductor.common.run.SearchResult) Test(org.junit.Test)

Aggregations

TaskSummary (com.netflix.conductor.common.run.TaskSummary)13 Task (com.netflix.conductor.common.metadata.tasks.Task)8 Workflow (com.netflix.conductor.common.run.Workflow)7 Test (org.junit.Test)7 ApplicationException (com.netflix.conductor.core.execution.ApplicationException)6 IOException (java.io.IOException)5 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)5 ParserException (com.netflix.conductor.elasticsearch.query.parser.ParserException)4 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 SearchResult (com.netflix.conductor.common.run.SearchResult)2 ArrayList (java.util.ArrayList)2 ResourceAlreadyExistsException (org.elasticsearch.ResourceAlreadyExistsException)2 UpdateRequest (org.elasticsearch.action.update.UpdateRequest)2 ResponseException (org.elasticsearch.client.ResponseException)2 IndexNotFoundException (org.elasticsearch.index.IndexNotFoundException)2 Trace (com.netflix.conductor.annotations.Trace)1 EventExecution (com.netflix.conductor.common.metadata.events.EventExecution)1 PollData (com.netflix.conductor.common.metadata.tasks.PollData)1 Status (com.netflix.conductor.common.metadata.tasks.Task.Status)1 TaskDef (com.netflix.conductor.common.metadata.tasks.TaskDef)1