### Question:
StoreByMetroAreaQueryController { @GetMapping("/stores-by-metro-area") public Collection<StoreByMetroAreaProjection> listStoresByLocation(@RequestParam String metroArea) { return repository.findAllProjectedByLocation(metroArea); } StoreByMetroAreaQueryController(StoreByMetroAreaRepository repository); @GetMapping("/stores-by-metro-area") Collection<StoreByMetroAreaProjection> listStoresByLocation(@RequestParam String metroArea);  }### Answer:
@Test public void listStoresByLocation() throws Exception { StoreByMetroAreaProjection storeProjection = makeStoreByMetroAreaProjection(); doReturn(singletonList(storeProjection)) .when(mockRepository) .findAllProjectedByLocation(any()); mockMvc .perform( get("/stores-by-metro-area") .param("metroArea", "some-metro-area") .accept(MediaType.APPLICATION_JSON_UTF8) ) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) .andReturn(); verify(mockRepository).findAllProjectedByLocation("some-metro-area"); }