@Test public void getGrid() throws Exception { this.mockMvc.perform(get("/demo/grid-data")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$", hasSize(5))) .andExpect(jsonPath("$[0].id", is(1))) .andExpect(jsonPath("$[0].character", is("Barbarian Queen"))) .andExpect(jsonPath("$[0].alignment", is("Neutral Evil"))); }
@RequestMapping(value = "/grid-data", method = RequestMethod.GET) public @ResponseBody List<GridRowDTO> getGrid() { LOGGER.info("get data for grid view", DemoController.class); List<GridRowDTO> gridRowDTOs = new ArrayList<GridRowDTO>(); gridRowDTOs.add(new GridRowDTO(1, "Barbarian Queen", "Neutral Evil")); gridRowDTOs.add(new GridRowDTO(2, "Global Senior Vice President of Sales", "Chaotic Evil")); gridRowDTOs.add(new GridRowDTO(3, "Jonathan the Piggy", "Glorious Good")); gridRowDTOs.add(new GridRowDTO(4, "Paladin Knight", "Lawful Good")); gridRowDTOs.add(new GridRowDTO(5, "Potato Chip", "Radiant Good")); return gridRowDTOs; }
DemoController { @RequestMapping(value = "/grid-data", method = RequestMethod.GET) public @ResponseBody List<GridRowDTO> getGrid() { LOGGER.info("get data for grid view", DemoController.class); List<GridRowDTO> gridRowDTOs = new ArrayList<GridRowDTO>(); gridRowDTOs.add(new GridRowDTO(1, "Barbarian Queen", "Neutral Evil")); gridRowDTOs.add(new GridRowDTO(2, "Global Senior Vice President of Sales", "Chaotic Evil")); gridRowDTOs.add(new GridRowDTO(3, "Jonathan the Piggy", "Glorious Good")); gridRowDTOs.add(new GridRowDTO(4, "Paladin Knight", "Lawful Good")); gridRowDTOs.add(new GridRowDTO(5, "Potato Chip", "Radiant Good")); return gridRowDTOs; } }
DemoController { @RequestMapping(value = "/grid-data", method = RequestMethod.GET) public @ResponseBody List<GridRowDTO> getGrid() { LOGGER.info("get data for grid view", DemoController.class); List<GridRowDTO> gridRowDTOs = new ArrayList<GridRowDTO>(); gridRowDTOs.add(new GridRowDTO(1, "Barbarian Queen", "Neutral Evil")); gridRowDTOs.add(new GridRowDTO(2, "Global Senior Vice President of Sales", "Chaotic Evil")); gridRowDTOs.add(new GridRowDTO(3, "Jonathan the Piggy", "Glorious Good")); gridRowDTOs.add(new GridRowDTO(4, "Paladin Knight", "Lawful Good")); gridRowDTOs.add(new GridRowDTO(5, "Potato Chip", "Radiant Good")); return gridRowDTOs; }  }
DemoController { @RequestMapping(value = "/grid-data", method = RequestMethod.GET) public @ResponseBody List<GridRowDTO> getGrid() { LOGGER.info("get data for grid view", DemoController.class); List<GridRowDTO> gridRowDTOs = new ArrayList<GridRowDTO>(); gridRowDTOs.add(new GridRowDTO(1, "Barbarian Queen", "Neutral Evil")); gridRowDTOs.add(new GridRowDTO(2, "Global Senior Vice President of Sales", "Chaotic Evil")); gridRowDTOs.add(new GridRowDTO(3, "Jonathan the Piggy", "Glorious Good")); gridRowDTOs.add(new GridRowDTO(4, "Paladin Knight", "Lawful Good")); gridRowDTOs.add(new GridRowDTO(5, "Potato Chip", "Radiant Good")); return gridRowDTOs; }  @RequestMapping(value = "/grid-data", method = RequestMethod.GET) @ResponseBody List<GridRowDTO> getGrid(); }
DemoController { @RequestMapping(value = "/grid-data", method = RequestMethod.GET) public @ResponseBody List<GridRowDTO> getGrid() { LOGGER.info("get data for grid view", DemoController.class); List<GridRowDTO> gridRowDTOs = new ArrayList<GridRowDTO>(); gridRowDTOs.add(new GridRowDTO(1, "Barbarian Queen", "Neutral Evil")); gridRowDTOs.add(new GridRowDTO(2, "Global Senior Vice President of Sales", "Chaotic Evil")); gridRowDTOs.add(new GridRowDTO(3, "Jonathan the Piggy", "Glorious Good")); gridRowDTOs.add(new GridRowDTO(4, "Paladin Knight", "Lawful Good")); gridRowDTOs.add(new GridRowDTO(5, "Potato Chip", "Radiant Good")); return gridRowDTOs; }  @RequestMapping(value = "/grid-data", method = RequestMethod.GET) @ResponseBody List<GridRowDTO> getGrid();  }