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