@Test public void testDeleteEmailTemplate() throws Exception { MvcResult result = mockMvc.perform(delete(CONTROLLER_PATH + "/template_name")).andReturn(); assertEquals(HttpStatus.OK.value(), result.getResponse().getStatus()); ArgumentCaptor<String> templateNameCaptor = ArgumentCaptor.forClass(String.class); verify(mailService).deleteTemplate(templateNameCaptor.capture()); assertThat(templateNameCaptor.getValue(), is("template_name")); }
@RequestMapping(path = "/{templateName:.+}", method = RequestMethod.DELETE) public ResponseEntity<?> deleteEmailTemplate(@PathVariable(value = "templateName") String templateName) throws AcmEmailConfigurationException { mailService.deleteTemplate(templateName); return new ResponseEntity<>(HttpStatus.OK); }
AcmMailTemplateConfigurationServiceAPIController { @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.DELETE) public ResponseEntity<?> deleteEmailTemplate(@PathVariable(value = "templateName") String templateName) throws AcmEmailConfigurationException { mailService.deleteTemplate(templateName); return new ResponseEntity<>(HttpStatus.OK); } }
AcmMailTemplateConfigurationServiceAPIController { @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.DELETE) public ResponseEntity<?> deleteEmailTemplate(@PathVariable(value = "templateName") String templateName) throws AcmEmailConfigurationException { mailService.deleteTemplate(templateName); return new ResponseEntity<>(HttpStatus.OK); }  }
AcmMailTemplateConfigurationServiceAPIController { @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.DELETE) public ResponseEntity<?> deleteEmailTemplate(@PathVariable(value = "templateName") String templateName) throws AcmEmailConfigurationException { mailService.deleteTemplate(templateName); return new ResponseEntity<>(HttpStatus.OK); }  @RequestMapping(method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE }) @ResponseBody List<EmailTemplateConfiguration> getTemplateConfigurations(); @RequestMapping(method = RequestMethod.PUT, consumes = { "multipart/mixed", MediaType.MULTIPART_FORM_DATA_VALUE }) ResponseEntity<?> updateEmailTemplate(@RequestPart("data") EmailTemplateConfiguration templateConfiguration,
            @RequestPart(value = "file", required = false) MultipartFile template); @RequestMapping(path = "/validate", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody EmailTemplateValidationResponse validateEmailTemplate(@RequestBody EmailTemplateConfiguration templateConfiguration); @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.DELETE) ResponseEntity<?> deleteEmailTemplate(@PathVariable(value = "templateName") String templateName); @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody Map<String, String> getEmailTemplate(@PathVariable(value = "templateName") String templateName); @ExceptionHandler(AcmEmailConfigurationException.class) @ResponseBody ResponseEntity<?> handleConfigurationException(AcmEmailServiceException ce); void setMailService(AcmMailTemplateConfigurationService mailService); }
AcmMailTemplateConfigurationServiceAPIController { @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.DELETE) public ResponseEntity<?> deleteEmailTemplate(@PathVariable(value = "templateName") String templateName) throws AcmEmailConfigurationException { mailService.deleteTemplate(templateName); return new ResponseEntity<>(HttpStatus.OK); }  @RequestMapping(method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE }) @ResponseBody List<EmailTemplateConfiguration> getTemplateConfigurations(); @RequestMapping(method = RequestMethod.PUT, consumes = { "multipart/mixed", MediaType.MULTIPART_FORM_DATA_VALUE }) ResponseEntity<?> updateEmailTemplate(@RequestPart("data") EmailTemplateConfiguration templateConfiguration,
            @RequestPart(value = "file", required = false) MultipartFile template); @RequestMapping(path = "/validate", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody EmailTemplateValidationResponse validateEmailTemplate(@RequestBody EmailTemplateConfiguration templateConfiguration); @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.DELETE) ResponseEntity<?> deleteEmailTemplate(@PathVariable(value = "templateName") String templateName); @RequestMapping(path = "/{templateName:.+}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody Map<String, String> getEmailTemplate(@PathVariable(value = "templateName") String templateName); @ExceptionHandler(AcmEmailConfigurationException.class) @ResponseBody ResponseEntity<?> handleConfigurationException(AcmEmailServiceException ce); void setMailService(AcmMailTemplateConfigurationService mailService);  }