@Test public void testGetJobs() throws Exception { AbstractJob jobBean = createGriffinJob(); jobBean.setJobName("job_name"); given(service.getAliveJobs("")) .willReturn(Collections.singletonList(jobBean)); mvc.perform( get(URLHelper.API_VERSION_PATH + "/jobs") .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$[0]['job.name']", is("job_name"))); }
@RequestMapping(value = "/jobs", method = RequestMethod.GET) public List<AbstractJob> getJobs(@RequestParam(value = "type", defaultValue = "") String type) { return jobService.getAliveJobs(type); }
JobController { @RequestMapping(value = "/jobs", method = RequestMethod.GET) public List<AbstractJob> getJobs(@RequestParam(value = "type", defaultValue = "") String type) { return jobService.getAliveJobs(type); } }
JobController { @RequestMapping(value = "/jobs", method = RequestMethod.GET) public List<AbstractJob> getJobs(@RequestParam(value = "type", defaultValue = "") String type) { return jobService.getAliveJobs(type); }  }
JobController { @RequestMapping(value = "/jobs", method = RequestMethod.GET) public List<AbstractJob> getJobs(@RequestParam(value = "type", defaultValue = "") String type) { return jobService.getAliveJobs(type); }  @RequestMapping(value = "/jobs", method = RequestMethod.GET) List<AbstractJob> getJobs(@RequestParam(value = "type",
        defaultValue = "") String type); @RequestMapping(value = "/jobs", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) AbstractJob addJob(@RequestBody AbstractJob job); @RequestMapping(value = "/jobs/config") AbstractJob getJobConfig(@RequestParam("jobId") Long jobId); @RequestMapping(value = "/jobs/{id}", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) AbstractJob onActions(
        @PathVariable("id") Long jobId,
        @RequestParam String action); @RequestMapping(value = "/jobs", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteJob(@RequestParam("jobName") String jobName); @RequestMapping(value = "/jobs/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteJob(@PathVariable("id") Long id); @RequestMapping(value = "/jobs/instances", method = RequestMethod.GET) List<JobInstanceBean> findInstancesOfJob(
        @RequestParam("jobId") Long id,
        @RequestParam("page") int page,
        @RequestParam("size") int size); @RequestMapping(value = "/jobs/instances/{instanceId}", method = RequestMethod.GET) JobInstanceBean findInstanceByInstanceId(@PathVariable("instanceId") Long id); @RequestMapping(value = "/jobs/health", method = RequestMethod.GET) JobHealth getHealthInfo(); @RequestMapping(path = "/jobs/download", method = RequestMethod.GET) ResponseEntity<Resource> download(
        @RequestParam("jobName") String jobName,
        @RequestParam("ts") long timestamp); @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) Map<String, Object> triggerJob(@PathVariable("id") Long id, @RequestBody(required = false) String request); @RequestMapping(value = "jobs/triggerKeys/{triggerKey:.+}", method = RequestMethod.GET) List<JobInstanceBean> findInstanceByTriggerKey(@PathVariable("triggerKey") String triggerKey); }
JobController { @RequestMapping(value = "/jobs", method = RequestMethod.GET) public List<AbstractJob> getJobs(@RequestParam(value = "type", defaultValue = "") String type) { return jobService.getAliveJobs(type); }  @RequestMapping(value = "/jobs", method = RequestMethod.GET) List<AbstractJob> getJobs(@RequestParam(value = "type",
        defaultValue = "") String type); @RequestMapping(value = "/jobs", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) AbstractJob addJob(@RequestBody AbstractJob job); @RequestMapping(value = "/jobs/config") AbstractJob getJobConfig(@RequestParam("jobId") Long jobId); @RequestMapping(value = "/jobs/{id}", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) AbstractJob onActions(
        @PathVariable("id") Long jobId,
        @RequestParam String action); @RequestMapping(value = "/jobs", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteJob(@RequestParam("jobName") String jobName); @RequestMapping(value = "/jobs/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteJob(@PathVariable("id") Long id); @RequestMapping(value = "/jobs/instances", method = RequestMethod.GET) List<JobInstanceBean> findInstancesOfJob(
        @RequestParam("jobId") Long id,
        @RequestParam("page") int page,
        @RequestParam("size") int size); @RequestMapping(value = "/jobs/instances/{instanceId}", method = RequestMethod.GET) JobInstanceBean findInstanceByInstanceId(@PathVariable("instanceId") Long id); @RequestMapping(value = "/jobs/health", method = RequestMethod.GET) JobHealth getHealthInfo(); @RequestMapping(path = "/jobs/download", method = RequestMethod.GET) ResponseEntity<Resource> download(
        @RequestParam("jobName") String jobName,
        @RequestParam("ts") long timestamp); @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) Map<String, Object> triggerJob(@PathVariable("id") Long id, @RequestBody(required = false) String request); @RequestMapping(value = "jobs/triggerKeys/{triggerKey:.+}", method = RequestMethod.GET) List<JobInstanceBean> findInstanceByTriggerKey(@PathVariable("triggerKey") String triggerKey);  }