JobRestController extends HerdBaseController { @RequestMapping(value = "/jobs/ids/{id}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_JOBS_PUT) public Job updateJob(@PathVariable("id") String id, @RequestBody JobUpdateRequest jobUpdateRequest) throws Exception { return jobService.updateJob(id, jobUpdateRequest); }  @RequestMapping(value = "/jobs", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_JOBS_POST) Job createJob(@RequestBody JobCreateRequest request); @RequestMapping(value = "/jobs", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_JOBS_GET) JobSummaries getJobs(@RequestParam(value = "namespace", required = false) String namespace,
        @RequestParam(value = "jobName", required = false) String jobName, @RequestParam(value = "status", required = false) JobStatusEnum status,
        @RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "endTime", required = false) String endTime); @RequestMapping(value = "/jobs/ids/{id}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_JOBS_GET_BY_ID) Job getJob(@PathVariable("id") String id, @RequestParam(value = "verbose", required = false, defaultValue = "false") Boolean verbose); @RequestMapping(value = "/jobs/signal", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_JOBS_SIGNAL_POST) Job signalJob(@RequestBody JobSignalRequest request); @RequestMapping(value = "/jobs/ids/{id}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_JOBS_PUT) Job updateJob(@PathVariable("id") String id, @RequestBody JobUpdateRequest jobUpdateRequest); @RequestMapping(value = "/jobs/ids/{id}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_JOBS_DELETE) Job deleteJob(@PathVariable("id") String id, @RequestBody JobDeleteRequest jobDeleteRequest);  }
@Test public void testUpdateJob() throws Exception { JobUpdateRequest jobUpdateRequest = new JobUpdateRequest(JobActionEnum.RESUME); Job job = new Job(); job.setId(JOB_ID); when(jobService.updateJob(JOB_ID, jobUpdateRequest)).thenReturn(job); Job result = jobRestController.updateJob(JOB_ID, jobUpdateRequest); verify(jobService).updateJob(JOB_ID, jobUpdateRequest); verifyNoMoreInteractionsHelper(); assertEquals(job, result); }