### Question:
UserController { @PutMapping("/password/{userId}/update") public String passwordUpdate( @PathVariable Integer userId, @RequestBody AuthenticationRequest plainPassword) throws Exception { return userService.passwordOfUserIdUpdate(userId, plainPassword.getPassword()); }  @GetMapping("/users") Iterable<User> getAllUsers(); @GetMapping("/exists/username/{username}") boolean existsUsername(@PathVariable String username); @GetMapping("/exists/email/{email}") boolean existsEmail(@PathVariable String email); @PostMapping("/signup") User insertUser(@RequestBody User newUser); @GetMapping("/profile/{username}") Profile getUserProfile(@PathVariable String username); @PutMapping("/profile/{username}") Profile updateUserProfile(
            @PathVariable String username, @RequestBody Profile updatedProfile); @PostMapping("/password/{userId}/matches") boolean passwordMatches(
            @PathVariable Integer userId, @RequestBody AuthenticationRequest plainPassword); @PutMapping("/password/{userId}/update") String passwordUpdate(
            @PathVariable Integer userId, @RequestBody AuthenticationRequest plainPassword); @DeleteMapping("/users/{userId}") void deleteUserAccount(@PathVariable Integer userId);  }### Answer:
@WithMockUser("spring") @Test @Order(7) public void passwordUpdate() throws Exception { String url = "/password/1/update"; AuthenticationRequest pass = new AuthenticationRequest("abcdefg", "abcd1234#"); String json = mapper.writeValueAsString(pass); mvc.perform( MockMvcRequestBuilders.put(url) .content(json) .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()); }