@Test public void testPopulatorNotFound() throws WorkflowNotFoundException { Optional<WorkFlow> res = ProcessPopulator.populate("not_found"); Assertions.assertThat(res).isEmpty(); }
private static void populate(final Map<String, WorkFlow> poolWorkflows, InputStream workflowFile, boolean update) { LOGGER.debug("Populating workflow using file " + workflowFile); Optional<WorkFlow> workflow = populate(workflowFile); if (workflow.isPresent()) { String wfId = workflow.get().getId(); LOGGER.debug("Parsed workflow with id " + wfId); if (update) { poolWorkflows.put(wfId, workflow.get()); } else { poolWorkflows.putIfAbsent(wfId, workflow.get()); } } }
ProcessPopulator { private static void populate(final Map<String, WorkFlow> poolWorkflows, InputStream workflowFile, boolean update) { LOGGER.debug("Populating workflow using file " + workflowFile); Optional<WorkFlow> workflow = populate(workflowFile); if (workflow.isPresent()) { String wfId = workflow.get().getId(); LOGGER.debug("Parsed workflow with id " + wfId); if (update) { poolWorkflows.put(wfId, workflow.get()); } else { poolWorkflows.putIfAbsent(wfId, workflow.get()); } } } }
ProcessPopulator { private static void populate(final Map<String, WorkFlow> poolWorkflows, InputStream workflowFile, boolean update) { LOGGER.debug("Populating workflow using file " + workflowFile); Optional<WorkFlow> workflow = populate(workflowFile); if (workflow.isPresent()) { String wfId = workflow.get().getId(); LOGGER.debug("Parsed workflow with id " + wfId); if (update) { poolWorkflows.put(wfId, workflow.get()); } else { poolWorkflows.putIfAbsent(wfId, workflow.get()); } } } private  ProcessPopulator(); }
ProcessPopulator { private static void populate(final Map<String, WorkFlow> poolWorkflows, InputStream workflowFile, boolean update) { LOGGER.debug("Populating workflow using file " + workflowFile); Optional<WorkFlow> workflow = populate(workflowFile); if (workflow.isPresent()) { String wfId = workflow.get().getId(); LOGGER.debug("Parsed workflow with id " + wfId); if (update) { poolWorkflows.put(wfId, workflow.get()); } else { poolWorkflows.putIfAbsent(wfId, workflow.get()); } } } private  ProcessPopulator(); static void loadWorkflow(final Map<String, WorkFlow> poolWorkflows); static void reloadWorkflow(final Map<String, WorkFlow> poolWorkflows, Long fromDate); static Optional<WorkFlow> populate(InputStream workflowFileStream); @VisibleForTesting static Optional<WorkFlow> populate(String workflowFile); }
ProcessPopulator { private static void populate(final Map<String, WorkFlow> poolWorkflows, InputStream workflowFile, boolean update) { LOGGER.debug("Populating workflow using file " + workflowFile); Optional<WorkFlow> workflow = populate(workflowFile); if (workflow.isPresent()) { String wfId = workflow.get().getId(); LOGGER.debug("Parsed workflow with id " + wfId); if (update) { poolWorkflows.put(wfId, workflow.get()); } else { poolWorkflows.putIfAbsent(wfId, workflow.get()); } } } private  ProcessPopulator(); static void loadWorkflow(final Map<String, WorkFlow> poolWorkflows); static void reloadWorkflow(final Map<String, WorkFlow> poolWorkflows, Long fromDate); static Optional<WorkFlow> populate(InputStream workflowFileStream); @VisibleForTesting static Optional<WorkFlow> populate(String workflowFile);  }