### Question:
HelloSpringBoot { @PostMapping("body") public Messages body(@RequestBody SysUser sysUser){ Messages messages = new Messages(); if(sysUser.getUsername() !=null && sysUser.getPassword() !=null && sysUser.getUsername().equals("user") && sysUser.getPassword().equals("springboot")){ messages.setStatus("success"); messages.setMessages("Login Success"); }else { messages.setStatus("error"); messages.setMessages("Login Error"); } return messages; }  @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 testBody() { SysUser sysUser = new SysUser("user", "springboot"); Messages messages = this.restTemplate.postForObject("/hello/body", sysUser, Messages.class); assertThat(messages.getStatus()).isEqualTo("success"); assertThat(messages.getMessages()).isEqualTo("Login Success"); }