### Question:
CategoryController { @RequestMapping(method = RequestMethod.GET) public Iterable<Category> getCategories() { return categoryService.findAll(); }  @RequestMapping(method = RequestMethod.GET) Iterable<Category> getCategories();  }### Answer:
@Test public void shouldReturnTheCategories() { List<Category> categories = TestDataFactory.getCategories(6); when(categoryService.findAll()).thenReturn(categories); assertThat(categoryController.getCategories()).isEqualTo(categories); }