ChronosController { @RequestMapping(value="/queue", method=RequestMethod.POST) public @ResponseBody Response queueJob(@RequestBody final PlannedJob aJob) { jobDao.addToQueue(aJob); return SUCCESS; } @Autowired  ChronosController(JobDao jobDao, AgentDriver agentDriver, AgentConsumer agentConsumer,
                           ArrayList<SupportedDriver> drivers, String reportRootPath); @ExceptionHandler(Exception.class) @ResponseBody Response internalExceptionHandler(Exception  exception,
    HttpServletRequest request, HttpServletResponse response); @RequestMapping(value="/jobs", method=RequestMethod.GET) @ResponseBody List<JobSpec> getJobs(); @RequestMapping(value="/jobs/history", method=RequestMethod.GET) @ResponseBody List<CallableJob> history(@RequestParam(value="id", required=false) Long id,
          @RequestParam(value="limit", required=true, defaultValue="100") Integer limit); @RequestMapping(value="/jobs/future", method=RequestMethod.GET) @ResponseBody List<FutureRunInfo> future(@RequestParam(value="id", required=false) Long id,
         @RequestParam(value="limit", required=true, defaultValue="100") Integer limit); static DateTime calcNextRunTime(final DateTime from, JobSpec job); void innerJobFuture(List<FutureRunInfo> toRet,
                             DateTime from, List<JobSpec> iterJobs); List<FutureRunInfo> getJobFuture(Long id, int limit); @RequestMapping(value="/job/{id}", method=RequestMethod.GET) @ResponseBody JobSpec getJob(@PathVariable("id") Long id); @RequestMapping(value="/job/{id}/children", method=RequestMethod.GET) @ResponseBody List<JobSpec> getChildren(@PathVariable("id") Long id); @RequestMapping(value="/job/{id}/tree", method=RequestMethod.GET) @ResponseBody JobNode getTree(@PathVariable("id") Long id); @RequestMapping(value="/job/version/{id}", method=RequestMethod.GET) @ResponseBody List<JobSpec> getJobVersions(@PathVariable("id") Long id); @RequestMapping(value="/sources", method=RequestMethod.GET) @ResponseBody ArrayList<SupportedDriver> getDataSources(); static Map<String, Long> assembleIdResp(long id); @RequestMapping(value="/job", method=RequestMethod.POST) @ResponseBody Map<String, Long> createJob(@RequestBody final JobSpec aJob); @RequestMapping(value="/job/{id}", method=RequestMethod.PUT) @ResponseBody Response updateJob(@PathVariable("id") Long id,
      @RequestBody final JobSpec aJob); @RequestMapping(value="/job/{id}", method=RequestMethod.DELETE) @ResponseBody Response deleteJob(@PathVariable("id") Long id); @ResponseBody List<Map<String,String>> getJobResults(
      @RequestParam("id") Long id,
      @RequestParam("limit") int limit); @RequestMapping(value="/running", method=RequestMethod.GET) @ResponseBody List<PlannedJob> getRunning(
      @RequestParam(value="id", required=false) Long id); @RequestMapping(value="/queue", method=RequestMethod.GET) @ResponseBody List<PlannedJob> getQueue(
      @RequestParam(value="id", required=false) Long id); @RequestMapping(value="/queue", method=RequestMethod.POST) @ResponseBody Response queueJob(@RequestBody final PlannedJob aJob); @RequestMapping(value="/queue", method=RequestMethod.DELETE) @ResponseBody Response cancelJob(@RequestBody final PlannedJob aJob); List<String> getReportsList(String root, Long id); @RequestMapping(value="/report-list", method=RequestMethod.GET) @ResponseBody List<String> getReportsList(
    @RequestParam(value="id", required=false) Long id); static Logger LOG; }
@Test public void testQueueJob() throws Exception { PlannedJob aJob = new PlannedJob(getTestJob("Some Job"), Utils.getCurrentTime()); MockHttpServletRequestBuilder request = post("/api/queue") .contentType(MediaType.APPLICATION_JSON) .content(OM.writeValueAsString(aJob)); mockMvc.perform(request) .andExpect(status().isOk()) .andExpect(content().string(success)); verify(jobDao, times(1)).addToQueue(aJob); }