@Test public void testGetLastUser() throws Exception { mockMvc.perform(get(Uris.RANKING_LAST_CREATED_USER).accept("application/json")).andExpect(status().isOk()).andExpect(jsonPath("$.[0].name").value("Adam")) .andExpect(jsonPath("$.[0].date").value("01.01.1970")).andExpect(jsonPath("$.[0].time").value("00:01:30")); }
@RequestMapping(value = Uris.RANKING_LAST_CREATED_USER, method = RequestMethod.GET) public List<TimeRankedUserData> getLastUser() { return _rankingRepository.getLastCreatedUser(PageRequest.of(0, 10)); }
RankingController { @RequestMapping(value = Uris.RANKING_LAST_CREATED_USER, method = RequestMethod.GET) public List<TimeRankedUserData> getLastUser() { return _rankingRepository.getLastCreatedUser(PageRequest.of(0, 10)); } }
RankingController { @RequestMapping(value = Uris.RANKING_LAST_CREATED_USER, method = RequestMethod.GET) public List<TimeRankedUserData> getLastUser() { return _rankingRepository.getLastCreatedUser(PageRequest.of(0, 10)); }  }
RankingController { @RequestMapping(value = Uris.RANKING_LAST_CREATED_USER, method = RequestMethod.GET) public List<TimeRankedUserData> getLastUser() { return _rankingRepository.getLastCreatedUser(PageRequest.of(0, 10)); }  @RequestMapping(value = Uris.RANKING_BEST_USER, method = RequestMethod.GET) Page<TreeRankedUserData> getBestUser(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, @RequestParam(value = "lastYear") boolean lastYear); @RequestMapping(value = Uris.RANKING_LAST_CREATED_USER, method = RequestMethod.GET) List<TimeRankedUserData> getLastUser(); @RequestMapping(value = Uris.RANKING_BEST_ORGANIZATION_TYPE + "{organizationType}", method = RequestMethod.GET) Page<TreeRankedUserData> getBestUserFromOrganizationType(@PathVariable OrganizationType organizationType, @Param(value = "page") int page, @Param(value = "size") int size,
            @RequestParam(value = "lastYear") boolean lastYear); @RequestMapping(value = Uris.RANKING_LAST_PLANTED_TREES, method = RequestMethod.GET) Page<TimeRankedTreeData> getLastPlantedTrees(@Param(value = "page") int page, @Param(value = "size") int size); @RequestMapping(value = Uris.RANKING_BEST_TEAM, method = RequestMethod.GET) Page<TreeRankedUserData> getBestTeams(@Param(value = "page") int page, @Param(value = "size") int size, @RequestParam(value = "lastYear") boolean lastYear); @RequestMapping(value = Uris.RANKING_BEST_USER_FOR_TIMERANGE + "{timeRange}", method = RequestMethod.GET) List<TreeRankedUserData> getBestUserFromTimeRange(@PathVariable String timeRange); @RequestMapping(value = Uris.RANKING_BEST_USER_FOR_PROJECT, method = RequestMethod.GET) Page<TreeRankedUserData> getBestUserForProject(@Param(value = "projectName") String projectName, @Param(value = "page") int page, @Param(value = "size") int size); @RequestMapping(value = Uris.RANKING_BEST_TEAM_FOR_PROJECT, method = RequestMethod.GET) Page<TreeRankedUserData> getBestTeamsForProject(@Param(value = "projectName") String projectName, @Param(value = "page") int page, @Param(value = "size") int size); @RequestMapping(value = Uris.RANKING_LAST_PLANTED_TREES_IN_PROJECT, method = RequestMethod.GET) Page<TimeRankedTreeData> getLastPlantedTreesInProject(@Param(value = "projectName") String projectName, @Param(value = "page") int page, @Param(value = "size") int size); }
RankingController { @RequestMapping(value = Uris.RANKING_LAST_CREATED_USER, method = RequestMethod.GET) public List<TimeRankedUserData> getLastUser() { return _rankingRepository.getLastCreatedUser(PageRequest.of(0, 10)); }  @RequestMapping(value = Uris.RANKING_BEST_USER, method = RequestMethod.GET) Page<TreeRankedUserData> getBestUser(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, @RequestParam(value = "lastYear") boolean lastYear); @RequestMapping(value = Uris.RANKING_LAST_CREATED_USER, method = RequestMethod.GET) List<TimeRankedUserData> getLastUser(); @RequestMapping(value = Uris.RANKING_BEST_ORGANIZATION_TYPE + "{organizationType}", method = RequestMethod.GET) Page<TreeRankedUserData> getBestUserFromOrganizationType(@PathVariable OrganizationType organizationType, @Param(value = "page") int page, @Param(value = "size") int size,
            @RequestParam(value = "lastYear") boolean lastYear); @RequestMapping(value = Uris.RANKING_LAST_PLANTED_TREES, method = RequestMethod.GET) Page<TimeRankedTreeData> getLastPlantedTrees(@Param(value = "page") int page, @Param(value = "size") int size); @RequestMapping(value = Uris.RANKING_BEST_TEAM, method = RequestMethod.GET) Page<TreeRankedUserData> getBestTeams(@Param(value = "page") int page, @Param(value = "size") int size, @RequestParam(value = "lastYear") boolean lastYear); @RequestMapping(value = Uris.RANKING_BEST_USER_FOR_TIMERANGE + "{timeRange}", method = RequestMethod.GET) List<TreeRankedUserData> getBestUserFromTimeRange(@PathVariable String timeRange); @RequestMapping(value = Uris.RANKING_BEST_USER_FOR_PROJECT, method = RequestMethod.GET) Page<TreeRankedUserData> getBestUserForProject(@Param(value = "projectName") String projectName, @Param(value = "page") int page, @Param(value = "size") int size); @RequestMapping(value = Uris.RANKING_BEST_TEAM_FOR_PROJECT, method = RequestMethod.GET) Page<TreeRankedUserData> getBestTeamsForProject(@Param(value = "projectName") String projectName, @Param(value = "page") int page, @Param(value = "size") int size); @RequestMapping(value = Uris.RANKING_LAST_PLANTED_TREES_IN_PROJECT, method = RequestMethod.GET) Page<TimeRankedTreeData> getLastPlantedTreesInProject(@Param(value = "projectName") String projectName, @Param(value = "page") int page, @Param(value = "size") int size);  }