@Test public void shouldCreateActionsForReports() throws Exception { List<ANMReport> anmReports = new ArrayList<>(); anmReports.add(new ANMReport("ANM X", asList(createSummaryForIUD()))); anmReports.add(new ANMReport("ANM Y", asList(createSummaryForANC()))); anmReportingService.processReports(anmReports); InOrder inOrder = inOrder(actionService); inOrder.verify(actionService).deleteReportActions(); inOrder .verify(actionService) .reportForIndicator( "ANM X", reportForIndicator( "IUD", "40", new Gson() .toJson( asList( new MonthSummaryDatum( "4", "2012", "2", "2", asList("CASE 1", "CASE 2")), new MonthSummaryDatum( "5", "2012", "2", "4", asList("CASE 3", "CASE 4")))))); inOrder .verify(actionService) .reportForIndicator( "ANM Y", reportForIndicator( "ANC", "30", new Gson() .toJson( asList( new MonthSummaryDatum( "6", "2012", "2", "2", asList("CASE 5", "CASE 6")))))); }
@Test public void shouldReportEntityDataToServices() throws Exception { anmReportingService.reportFromEntityData(); verify(childReportingService).reportInfantAndChildBalance(); }