CronTaskController extends BaseController { @ApiOperation(value = "Lists all of the cron task types and the field types of those tasks.") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIGURATION), @ApiResponse(code = 404, message = NOT_FOUND_CONFIGURATION) }) @GetMapping(value = "/types/list", produces = { MediaType.APPLICATION_JSON_VALUE }) public ResponseEntity listCronJobs() { return ResponseEntity.ok(cronJobsDefinitionsRegistry.getCronJobDefinitions()); }  @ApiOperation(value = "Used to save a new cron task job") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_SAVE_CONFIGURATION), @ApiResponse(code = 400, message = FAILED_SAVE_CONFIGURATION) }) @PutMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_JSON_VALUE }) ResponseEntity create(@RequestBody @Validated CronTaskConfigurationForm cronTaskConfigurationForm,
                                 BindingResult bindingResult,
                                 @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader); @ApiOperation(value = "Used to update an existing configuration") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_UPDATE_CONFIGURATION), @ApiResponse(code = 400, message = FAILED_UPDATE_CONFIGURATION) }) @PutMapping(value = "/{UUID}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_JSON_VALUE }) ResponseEntity updateConfiguration(@PathVariable("UUID") UUID uuid,
                                              @RequestBody @Validated CronTaskConfigurationForm cronTaskConfigurationForm,
                                              BindingResult bindingResult,
                                              @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader); @ApiOperation(value = "Used to delete the configuration") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_DELETE_CONFIGURATION), @ApiResponse(code = 400, message = FAILED_DELETE_CONFIGURATION) }) @DeleteMapping(value = "{UUID}", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_JSON_VALUE }) ResponseEntity deleteConfiguration(@PathVariable("UUID") UUID uuid,
                                              @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader); @ApiOperation(value = "Lists all of the cron task types and the field types of those tasks.") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIGURATION), @ApiResponse(code = 404, message = NOT_FOUND_CONFIGURATION) }) @GetMapping(value = "/types/list", produces = { MediaType.APPLICATION_JSON_VALUE }) ResponseEntity listCronJobs(); @ApiOperation(value = "Used to get the configuration on given cron task UUID") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIGURATION), @ApiResponse(code = 404, message = NOT_FOUND_CONFIGURATION) }) @GetMapping(value = "/{UUID}", produces = { MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML_VALUE }) ResponseEntity getConfiguration(@PathVariable("UUID") UUID uuid,
                                           @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader); @ApiOperation(value = "Used to get list of all the configurations") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIGURATIONS), @ApiResponse(code = 404, message = NOT_FOUND_CONFIGURATIONS) }) @GetMapping(produces = { MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML_VALUE }) ResponseEntity getConfigurations(@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader); @ApiOperation(value = "Used to upload groovy script for groovy cron task") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_UPLOAD_GROOVY_SCRIPT), @ApiResponse(code = 400, message = FAILED_UPLOAD_GROOVY_SCRIPT) }) @PutMapping(value = "/cron/groovy/{UUID}", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_JSON_VALUE }) ResponseEntity uploadGroovyScript(@PathVariable("UUID") UUID uuid,
                                             HttpServletRequest request,
                                             @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader); @ApiOperation(value = "Used to get all groovy scripts names") @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_GROOVY_SCRIPTS) }) @GetMapping(value = "/groovy/names", produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity getGroovyScriptsName();  }
@Test public void testListCronJobs() { mockMvc.contentType(MediaType.APPLICATION_JSON_VALUE) .accept(MediaType.APPLICATION_JSON_VALUE) .when() .get(getContextBaseUrl() + "/types/list") .peek() .then() .statusCode(OK); }