@Test public void testDeleteReport() throws Exception { final String getReportFromTargetNameMethodName = "getReportFromTargetName"; final String reportName = "reportName"; final Report report = new Report(reportName); ReportDao tested = createPartialMock(ReportDao.class, getReportFromTargetNameMethodName); Cache cacheMock = createMock(Cache.class); Whitebox.setInternalState(tested, "cache", cacheMock); expectPrivate(tested, getReportFromTargetNameMethodName, reportName).andReturn(report); cacheMock.invalidateCache(report); expectLastCall().once(); replay(tested, cacheMock); tested.deleteReport(reportName); verify(tested, cacheMock); }
public void deleteReport(final String reportName) { Report report = getReportFromTargetName(reportName); cache.invalidateCache(report); }
ReportDao { public void deleteReport(final String reportName) { Report report = getReportFromTargetName(reportName); cache.invalidateCache(report); } }
ReportDao { public void deleteReport(final String reportName) { Report report = getReportFromTargetName(reportName); cache.invalidateCache(report); }  }
ReportDao { public void deleteReport(final String reportName) { Report report = getReportFromTargetName(reportName); cache.invalidateCache(report); }  void deleteReport(final String reportName); }
ReportDao { public void deleteReport(final String reportName) { Report report = getReportFromTargetName(reportName); cache.invalidateCache(report); }  void deleteReport(final String reportName);  }