DatabaseSetController { @RequestMapping(value = "/sync") public ServiceResult<String> sync(@RequestParam("id") Long id, @CurrentUser LoginUser user) throws Exception { DatabaseSet databaseSet = databaseSetDao.getDatabaseSetById(id); return databaseSetService.syncDbSet(user, databaseSet); }  @RequestMapping(value = "{groupId}/list") ServiceResult<List<DatabaseSet>> lists(@PathVariable("groupId") Long groupId); @RequestMapping(value = "/list") ServiceResult<List<DatabaseSetView>> list(@RequestParam(value = "projectId") Long projectId); @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdateDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeleteDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/sync") ServiceResult<String> sync(@RequestParam("id") Long id, @CurrentUser LoginUser user); @RequestMapping(value = "/check") ConfigCkeckResult check(@CurrentUser LoginUser user, @RequestParam("id") Long id); @RequestMapping(value = "/groupCheck") ConfigCkeckResult<ConfigCheckItem> groupCheck(@CurrentUser LoginUser user, @RequestParam("gourpId") Long gourpId); @RequestMapping(value = "/getdbsetnames") ServiceResult<String> getdbsetnames(@RequestParam("projectId") Long projectId); @RequestMapping(value = "/syncdb") ServiceResult<String> syncdb(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping("/buttons") ServiceResult getDbSetButton(@CurrentUser LoginUser user);  }
@Test public void sync() throws Exception { mockMvc.perform(MockMvcRequestBuilders.post("/groupdbset/sync") .contentType(MediaType.APPLICATION_JSON_UTF8) .param("id", "1") .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }