EmailTemplateController implements IEmailTemplateClient { @Override @PutMapping("/emailTemplates") public boolean updateEmailTemplate(@RequestBody IEmailTemplate emailTemplate) { return this.emailTemplateDao.getEmailTemplate(emailTemplate.getName()) != null && emailTemplateDao.updateEmailTemplate(emailTemplate); }  @Override @GetMapping("/emailTemplates") List<IEmailTemplate> listEmailTemplates(); @GetMapping("/emailTemplates/{emailTemplateType}") IEmailTemplate getEmailTemplate(@PathVariable String emailTemplateType); @Override @PutMapping("/emailTemplates") boolean updateEmailTemplate(@RequestBody IEmailTemplate emailTemplate); @Override @PostMapping("/emailTemplates") IEmailTemplate createEmailTemplate(@RequestBody IEmailTemplate emailTemplate);  }
@Test public void shouldUpdateEmailTemplatesInPost() throws Exception { IEmailTemplate contestEmailTemplate = AdminTestUtils.getContestEmailTemplate(); this.mockMvc.perform( put("/emailTemplates") .contentType(contentType).accept(contentType) .content(objectMapper.writeValueAsString(contestEmailTemplate))) .andExpect(status().isOk()); Mockito.verify(emailTemplateDao, atLeast(1)).updateEmailTemplate(anyObject()); }