SlaCheckerEmailService { public void sendCloseIncidentEmail(long incidentId) { logger.debug("Send close incident email"); String closeIncidentEmailContent = getCloseIncidentEmailContent(incidentId); sendEmail(incidentId, closeIncidentEmailContent); }  void sendCloseIncidentEmail(long incidentId); void sendOpenIncidentEmail(long incidentId, List<Repository> ooslaRepositories); boolean shouldResendEmail(DateTime previousEmailDateTime);  }
@Test public void testSendCloseIncidentEmail() { String emailContent = "close content"; long incidentId = 0L; doNothing().when(slaCheckerEmailService).sendEmail(incidentId, emailContent); doReturn(emailContent).when(slaCheckerEmailService).getCloseIncidentEmailContent(incidentId); slaCheckerEmailService.sendCloseIncidentEmail(incidentId); Mockito.verify(slaCheckerEmailService).sendEmail(incidentId, emailContent); }