@Test public void testUpdate() throws Exception { log.info("update"); User user = mockDataService.user(); String userId = user.getId(); assertThat(accountService.findOne(userId).getSchool()).isEqualTo(user.getSchool()); user = user.toBuilder().school("test school").password("empty").build(); mvc.perform(patch("/api/accounts/{userId}.json", userId) .content(objectMapper.writeValueAsString(user)).contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()) .andReturn(); assertThat(accountService.findOne(userId).getSchool()).isEqualTo("test school"); assertTrue(passwordEncoder.matches(userId, accountService.findOne(userId).getPassword()), "password should not be changed"); }
@PatchMapping("{userId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void update(@PathVariable("userId") String userId, @RequestBody User user) { accountService.updateSelective(userId, user.toBuilder().password(null).build()); }
AccountController { @PatchMapping("{userId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void update(@PathVariable("userId") String userId, @RequestBody User user) { accountService.updateSelective(userId, user.toBuilder().password(null).build()); } }
AccountController { @PatchMapping("{userId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void update(@PathVariable("userId") String userId, @RequestBody User user) { accountService.updateSelective(userId, user.toBuilder().password(null).build()); }  }
AccountController { @PatchMapping("{userId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void update(@PathVariable("userId") String userId, @RequestBody User user) { accountService.updateSelective(userId, user.toBuilder().password(null).build()); }  @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(); }
AccountController { @PatchMapping("{userId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void update(@PathVariable("userId") String userId, @RequestBody User user) { accountService.updateSelective(userId, user.toBuilder().password(null).build()); }  @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();  }