AccountController { @ResponseStatus(HttpStatus.NO_CONTENT) @PostMapping(value = "import", consumes = APPLICATION_JSON_VALUE) public void importUsers(@RequestBody AccountImportForm form) { accountService.importUsers(form); }  @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 testImportUsers() throws Exception { log.info("importUsers"); AccountImportForm form = new AccountImportForm(); Account account = toAccount(mockDataService.user(false)); Account account2 = toAccount(mockDataService.user(false)); form.setContent(Arrays.asList(account, account2)); expect(form, HttpStatus.NO_CONTENT); account.setExists(true); account2.setExists(true); expect(form, HttpStatus.BAD_REQUEST); form.getExistsPolicy().add(AccountImportForm.ExistPolicy.ENABLE); expect(form, HttpStatus.NO_CONTENT); }