### Question:
ScheduleController { @RequestMapping(value = "/job", method = RequestMethod.DELETE) public ResponseEntity<?> deleteScheduleJob(@ModelAttribute JobRequest jobRequest) { JobKey jobKey = new JobKey(jobRequest.getJobName(), jobRequest.getJobGroup()); if (scheduleService.isJobExists(jobKey)) { if (!scheduleService.isJobRunning(jobKey)) { scheduleService.deleteJob(jobKey); } else { return new ResponseEntity<>(new ApiResponse(false, "Job already in running state"), HttpStatus.BAD_REQUEST); } } else { return new ResponseEntity<>(new ApiResponse(false, "Job does not exits"), HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(new ApiResponse(true, "Job deleted successfully"), HttpStatus.OK); }  @RequestMapping(value = "/job", method = RequestMethod.POST) ResponseEntity<?> addScheduleJob(@ModelAttribute JobRequest jobRequest); @RequestMapping(value = "/job", method = RequestMethod.DELETE) ResponseEntity<?> deleteScheduleJob(@ModelAttribute JobRequest jobRequest); @RequestMapping(value = "/jobs", method = RequestMethod.GET) JobStatusResponse getAllJobs(); @RequestMapping(value = "/job/pause", method = RequestMethod.PUT) ResponseEntity<?> pauseJob(@ModelAttribute JobRequest jobRequest); @RequestMapping(value = "/job/resume", method = RequestMethod.PUT) ResponseEntity<?> resumeJob(@ModelAttribute JobRequest jobRequest);  }### Answer:
@Test public void deleteScheduleJob() throws Exception { given(scheduleService.deleteJob(anyObject())).willReturn(true); given(scheduleService.isJobExists(anyObject())).willReturn(true); given(scheduleService.isJobRunning(anyObject())).willReturn(false); mvc.perform(delete(BASE_PATH + "/job") .param("jobName", "job1") .param("jobGroup", "testGroup")) .andDo(print()) .andExpect(status().isOk()) .andExpect(jsonPath("$.success", is(true))); verify(scheduleService).deleteJob(anyObject()); verify(scheduleService).isJobExists(anyObject()); verify(scheduleService).isJobRunning(anyObject()); }