AccountController { @PatchMapping("{userId}/password") @ResponseStatus(HttpStatus.NO_CONTENT) public void updatePassword(@PathVariable("userId") String userId, @RequestBody UserPasswordForm user) { accountService.updatePassword(userId, user.getPassword()); }  @GetMapping Page<User> findAll(AccountForm form, @PageableDefault(50) Pageable pageable); @PatchMapping("{userId}") @ResponseStatus(HttpStatus.NO_CONTENT) void update(@PathVariable("userId") String userId, @RequestBody User user); @PatchMapping("{userId}/password") @ResponseStatus(HttpStatus.NO_CONTENT) void updatePassword(@PathVariable("userId") String userId, @RequestBody UserPasswordForm user); @GetMapping(produces = XLSX_VALUE) void findAllXlsx(AccountForm form, Pageable pageable, @Nullable Locale requestLocale,
            HttpServletResponse response); @GetMapping(produces = XLS_VALUE) void findAllXls(AccountForm form, Pageable pageable, @Nullable Locale requestLocale,
            HttpServletResponse response); @PostMapping(consumes = MULTIPART_FORM_DATA_VALUE) List<Account> parseExcel(@RequestParam("file") MultipartFile multipartFile,
            @Nullable Locale locale); @ResponseStatus(HttpStatus.NO_CONTENT) @PostMapping(value = "import", consumes = APPLICATION_JSON_VALUE) void importUsers(@RequestBody AccountImportForm form); @GetMapping("password/status") Map<String, ?> passwordStatus();  }
@Test public void testUpdatePassword() throws Exception { log.info("updatePassword"); String userId = mockDataService.user().getId(); UserPasswordForm form = new UserPasswordForm(); String newPassword = Utility.getRandomString(16); form.setPassword(newPassword); MvcResult result = mvc.perform(patch("/api/accounts/{userId}/password.json", userId) .content(objectMapper.writeValueAsString(form)).contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()) .andReturn(); assertTrue(passwordEncoder.matches(newPassword, accountService.findOne(userId).getPassword())); }