use of com.netflix.conductor.common.run.WorkflowSummary in project conductor by Netflix.
the class TestElasticSearchRestDAOV6 method shouldAsyncUpdateWorkflow.
@Test
public void shouldAsyncUpdateWorkflow() throws Exception {
Workflow workflow = TestUtils.loadWorkflowSnapshot("workflow");
WorkflowSummary summary = new WorkflowSummary(workflow);
indexDAO.indexWorkflow(workflow);
indexDAO.asyncUpdateWorkflow(workflow.getWorkflowId(), new String[] { "status" }, new Object[] { Workflow.WorkflowStatus.FAILED }).get();
summary.setStatus(Workflow.WorkflowStatus.FAILED);
assertWorkflowSummary(workflow.getWorkflowId(), summary);
}
use of com.netflix.conductor.common.run.WorkflowSummary in project conductor by Netflix.
the class TestElasticSearchRestDAOV6 method shouldIndexWorkflowAsync.
@Test
public void shouldIndexWorkflowAsync() throws Exception {
Workflow workflow = TestUtils.loadWorkflowSnapshot("workflow");
WorkflowSummary summary = new WorkflowSummary(workflow);
indexDAO.asyncIndexWorkflow(workflow).get();
assertWorkflowSummary(workflow.getWorkflowId(), summary);
}
use of com.netflix.conductor.common.run.WorkflowSummary in project conductor by Netflix.
the class AbstractProtoMapper method fromProto.
public WorkflowSummary fromProto(WorkflowSummaryPb.WorkflowSummary from) {
WorkflowSummary to = new WorkflowSummary();
to.setWorkflowType(from.getWorkflowType());
to.setVersion(from.getVersion());
to.setWorkflowId(from.getWorkflowId());
to.setCorrelationId(from.getCorrelationId());
to.setStartTime(from.getStartTime());
to.setUpdateTime(from.getUpdateTime());
to.setEndTime(from.getEndTime());
to.setStatus(fromProto(from.getStatus()));
to.setInput(from.getInput());
to.setOutput(from.getOutput());
to.setReasonForIncompletion(from.getReasonForIncompletion());
to.setExecutionTime(from.getExecutionTime());
to.setEvent(from.getEvent());
to.setFailedReferenceTaskNames(from.getFailedReferenceTaskNames());
to.setExternalInputPayloadStoragePath(from.getExternalInputPayloadStoragePath());
to.setExternalOutputPayloadStoragePath(from.getExternalOutputPayloadStoragePath());
to.setPriority(from.getPriority());
return to;
}
use of com.netflix.conductor.common.run.WorkflowSummary in project conductor by Netflix.
the class WorkflowServiceImplTest method searchByTasksTest.
@Test
public void searchByTasksTest() throws InterruptedException {
CountDownLatch streamAlive = new CountDownLatch(1);
AtomicReference<WorkflowServicePb.WorkflowSummarySearchResult> result = new AtomicReference<>();
SearchPb.Request req = SearchPb.Request.newBuilder().setStart(1).setSize(1).setSort("strings").setQuery("").setFreeText("").build();
StreamObserver<WorkflowServicePb.WorkflowSummarySearchResult> streamObserver = new StreamObserver<WorkflowServicePb.WorkflowSummarySearchResult>() {
@Override
public void onNext(WorkflowServicePb.WorkflowSummarySearchResult value) {
result.set(value);
}
@Override
public void onError(Throwable t) {
streamAlive.countDown();
}
@Override
public void onCompleted() {
streamAlive.countDown();
}
};
WorkflowSummary workflow = new WorkflowSummary();
SearchResult<WorkflowSummary> searchResult = new SearchResult<>();
searchResult.setTotalHits(1);
searchResult.setResults(Collections.singletonList(workflow));
when(workflowService.searchWorkflowsByTasks(anyInt(), anyInt(), anyList(), anyString(), anyString())).thenReturn(searchResult);
workflowServiceImpl.searchByTasks(req, streamObserver);
streamAlive.await(10, TimeUnit.MILLISECONDS);
WorkflowServicePb.WorkflowSummarySearchResult workflowSearchResult = result.get();
assertEquals(1, workflowSearchResult.getTotalHits());
assertEquals(WorkflowSummaryPb.WorkflowSummary.newBuilder().build(), workflowSearchResult.getResultsList().get(0));
}
use of com.netflix.conductor.common.run.WorkflowSummary in project conductor by Netflix.
the class TestElasticSearchRestDAOV7 method shouldUpdateWorkflow.
@Test
public void shouldUpdateWorkflow() {
Workflow workflow = TestUtils.loadWorkflowSnapshot("workflow");
WorkflowSummary summary = new WorkflowSummary(workflow);
indexDAO.indexWorkflow(workflow);
indexDAO.updateWorkflow(workflow.getWorkflowId(), new String[] { "status" }, new Object[] { Workflow.WorkflowStatus.COMPLETED });
summary.setStatus(Workflow.WorkflowStatus.COMPLETED);
assertWorkflowSummary(workflow.getWorkflowId(), summary);
}
Aggregations