### Question:
HelloSpringBoot { @PostMapping(value = "path/{username}") public Messages pathVariable(@PathVariable("username") String username){ return new Messages("success","Hello "+ username); }  @RequestMapping("string") @ResponseStatus(HttpStatus.OK) String helloString(); @RequestMapping(value = "json") Messages helloJson(); @GetMapping(value = "param") Messages param(@RequestParam(value ="username",defaultValue = "Boot") String username); @PostMapping(value = "path/{username}") Messages pathVariable(@PathVariable("username") String username); @PostMapping("body") Messages body(@RequestBody SysUser sysUser); @PostMapping("text") String text(@RequestBody String  text); @PostMapping("form") Messages form(SysUser sysUser);  }### Answer:
@Test void testPathVariable() throws Exception { this.mvc.perform(post("/hello/path/xiaoxian")).andExpect(status().isOk()) .andExpect(content().json("{'status':'success';'messages':'Hello xiaoxian'}")); }