@Test public void parsesIDsParameterMissing() throws Exception { HttpServletRequest req = mock(HttpServletRequest.class); when(req.getParameter(CelosClient.IDS_PARAM)).thenReturn(null); Assert.assertEquals(Collections.emptySet(), new SchedulerServlet().getWorkflowIDs(req)); }
Set<WorkflowID> getWorkflowIDs(HttpServletRequest req) { String idString = req.getParameter(CelosClient.IDS_PARAM); if (idString == null) { return Collections.<WorkflowID>emptySet(); } else { String[] idArray = idString.split(","); Set<WorkflowID> workflowIDs = new HashSet<>(); for (int i = 0; i < idArray.length; i++) { workflowIDs.add(new WorkflowID(idArray[i])); } return workflowIDs; } }
SchedulerServlet extends AbstractServlet { Set<WorkflowID> getWorkflowIDs(HttpServletRequest req) { String idString = req.getParameter(CelosClient.IDS_PARAM); if (idString == null) { return Collections.<WorkflowID>emptySet(); } else { String[] idArray = idString.split(","); Set<WorkflowID> workflowIDs = new HashSet<>(); for (int i = 0; i < idArray.length; i++) { workflowIDs.add(new WorkflowID(idArray[i])); } return workflowIDs; } } }
SchedulerServlet extends AbstractServlet { Set<WorkflowID> getWorkflowIDs(HttpServletRequest req) { String idString = req.getParameter(CelosClient.IDS_PARAM); if (idString == null) { return Collections.<WorkflowID>emptySet(); } else { String[] idArray = idString.split(","); Set<WorkflowID> workflowIDs = new HashSet<>(); for (int i = 0; i < idArray.length; i++) { workflowIDs.add(new WorkflowID(idArray[i])); } return workflowIDs; } }  }
SchedulerServlet extends AbstractServlet { Set<WorkflowID> getWorkflowIDs(HttpServletRequest req) { String idString = req.getParameter(CelosClient.IDS_PARAM); if (idString == null) { return Collections.<WorkflowID>emptySet(); } else { String[] idArray = idString.split(","); Set<WorkflowID> workflowIDs = new HashSet<>(); for (int i = 0; i < idArray.length; i++) { workflowIDs.add(new WorkflowID(idArray[i])); } return workflowIDs; } }   }
SchedulerServlet extends AbstractServlet { Set<WorkflowID> getWorkflowIDs(HttpServletRequest req) { String idString = req.getParameter(CelosClient.IDS_PARAM); if (idString == null) { return Collections.<WorkflowID>emptySet(); } else { String[] idArray = idString.split(","); Set<WorkflowID> workflowIDs = new HashSet<>(); for (int i = 0; i < idArray.length; i++) { workflowIDs.add(new WorkflowID(idArray[i])); } return workflowIDs; } }    }