use of com.netflix.conductor.tests.utils.MockExternalPayloadStorage.TEMP_FILE_PATH in project conductor by Netflix.
the class AbstractWorkflowServiceTest method clearWorkflows.
@After
public void clearWorkflows() throws Exception {
List<String> workflowsWithVersion = metadataService.getWorkflowDefs().stream().map(def -> def.getName() + ":" + def.getVersion()).collect(Collectors.toList());
for (String workflowWithVersion : workflowsWithVersion) {
String workflowName = StringUtils.substringBefore(workflowWithVersion, ":");
int version = Integer.parseInt(StringUtils.substringAfter(workflowWithVersion, ":"));
List<String> running = workflowExecutionService.getRunningWorkflows(workflowName, version);
for (String wfid : running) {
Workflow workflow = workflowExecutor.getWorkflow(wfid, false);
if (!workflow.getStatus().isTerminal()) {
workflowExecutor.terminateWorkflow(wfid, "cleanup");
}
}
}
queueDAO.queuesDetail().keySet().forEach(queueDAO::flush);
new FileOutputStream(this.getClass().getResource(TEMP_FILE_PATH).getPath()).close();
}
Aggregations