### Question:
UserController2 { @GetMapping("/get") public UserVO get(@RequestParam("id") Integer id) { return new UserVO().setId(id).setUsername(UUID.randomUUID().toString()); }  @GetMapping("/list") // URL 修改成 /list List<UserVO> list(); @GetMapping("/get") // URL 修改成 /get UserVO get(@RequestParam("id") Integer id); @PostMapping("add") // URL 修改成 /add Integer add(UserAddDTO addDTO); @PostMapping("/update") // URL 修改成 /update ，RequestMethod 改成 POST Boolean update(UserUpdateDTO updateDTO); @DeleteMapping("/delete") // URL 修改成 /delete ，RequestMethod 改成 DELETE Boolean delete(@RequestParam("id") Integer id);  }### Answer:
@Test public void testGet2() throws Exception { System.out.println("before mock:" + userService.get(1)); Mockito.when(userService.get(1)).thenReturn( new UserVO().setId(1).setUsername("username:1")); System.out.println("after mock:" + userService.get(1)); ResultActions resultActions = mvc.perform(MockMvcRequestBuilders.get("/users/v2/1")); resultActions.andExpect(MockMvcResultMatchers.status().isOk()); resultActions.andExpect(MockMvcResultMatchers.content().json("{\n" + " \"id\": 1,\n" + " \"username\": \"username:1\"\n" + "}")); }