### Question:
UserLoginWeb { @ApiOperation(value = "用户注册", httpMethod = "POST",code = 200,produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/register",method = RequestMethod.POST, produces = { "application/json"}) @PreventResubmitLock(prefix = "USER:REGISTER") public MsgResponseBody<String> register(@RequestBody @PreventParam(name = "userPhone") UserVo userVo) { userService.register(userVo); return MsgResponseBody.success().setResult("注册成功"); }  @ApiOperation(value = "用户登陆", httpMethod = "POST",code = 200,produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/login",method = RequestMethod.POST, produces = { "application/json"}) //限流 10秒内最多允许1000次访问 @Limit(key = "USER:LOGIN", period = 10, count = 1000) MsgResponseBody<JWTUserDetail> login(@RequestJsonParam("userName") String userName, @RequestJsonParam("passWord") String passWord); @ApiOperation(value = "用户注册", httpMethod = "POST",code = 200,produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/register",method = RequestMethod.POST, produces = { "application/json"}) //默认5秒内同一手机号不可重复提交 @PreventResubmitLock(prefix = "USER:REGISTER") //cache会在方法执行后缓存,相当于更新了缓存,少了一步查询缓存 MsgResponseBody<String> register(@RequestBody @PreventParam(name = "userPhone") UserVo userVo);  }### Answer:
@Test public void register() throws Exception { UserVo userVo=new UserVo(); userVo.setAccountname("senssic"); userVo.setPassword("123456"); userVo.setUserPhone("17602178369"); mvc.perform(MockMvcRequestBuilders.post("/sc/user/auth/register").content(JsonMapper.nonDefaultMapper().toJson(userVo)).contentType(MediaType.APPLICATION_JSON_UTF8). accept(MediaType.APPLICATION_JSON_UTF8)).andExpect(MockMvcResultMatchers.status().isOk()). andDo(MockMvcResultHandlers.print()). andReturn(); }