AllReports { public void handleAction(Action action) { repository.update(new Report(action.type(), action.get("annualTarget"), action.get("monthlySummaries"))); } AllReports(ReportRepository repository); void handleAction(Action action); List<Report> allFor(List<ReportIndicator> indicators);  }
@Test public void shouldDelegateActionToReportRepository() throws Exception { Action iudAction = ActionBuilder.actionForReport("IUD", "40"); allReports.handleAction(iudAction); verify(repository).update(new Report("IUD", "40", "some-month-summary-json")); }
@Test public void shouldDelegateActionToReportRepository() throws Exception { Action iudAction = ActionBuilder.actionForReport("IUD", "40"); allReports.handleAction(iudAction); Mockito.verify(repository).update(new Report("IUD", "40", "some-month-summary-json")); }