ReportDataController { @RequestMapping(value = "/report/fetchForAllANMs", method = RequestMethod.GET) @ResponseBody public List<ANMReport> getAllANMsIndicatorSummaries() { return anmReportsRepository.fetchAllANMsReport(); } @Autowired  ReportDataController(ServicesProvidedRepository servicesProvidedRepository,
                                ANMReportsRepository anmReportsRepository); @RequestMapping(value = "/report/submit", method = RequestMethod.POST) @ResponseBody String submit(@RequestBody ReportingData reportingData); @RequestMapping(headers = {"Accept=application/json"}, value = "/report/update", method = RequestMethod.POST) @ResponseBody String updateReports(@RequestBody ReportDataUpdateRequest request); @RequestMapping(headers = {"Accept=application/json"}, value = "/report/delete", method = RequestMethod.POST) @ResponseBody String deleteReports(@RequestBody ReportDataDeleteRequest request); @RequestMapping(value = "/report/fetchForAllANMs", method = RequestMethod.GET) @ResponseBody List<ANMReport> getAllANMsIndicatorSummaries();  }
@Test public void shouldReturnListOfANMIndicatorSummaryForAllANMs() throws Exception { ANMReport anmXReport = new ANMReport("ANM X", asList(createSummaryForIUD())); ANMReport anmYReport = new ANMReport("ANM Y", asList(createSummaryForANC())); when(anmReportsRepository.fetchAllANMsReport()).thenReturn(asList(anmXReport, anmYReport)); List<ANMReport> summaries = controller.getAllANMsIndicatorSummaries(); assertEquals(asList(anmXReport, anmYReport), summaries); }