### Question:
BookController { @PostMapping(value = "/list") @Log(name = "图书管理", value = "查询图书") @ApiOperation(value = "查看图书列表", notes = "可以通过查询条件查询图书列表,包括分页信息") @ApiPageable public ApiResult<Page<BookDto>> list(Pageable pageable, @RequestBody @Valid @ApiParam("查询参数") SearchBookParam searchParam, @ModelAttribute("user") User user) { System.out.println(user); System.out.println(user.getId() + "---" + user.getUsername()); System.out.println(searchParam.name); System.out.println(searchParam.bookType); System.out.println(searchParam.shopId); Page<BookDto> bookDtoPage = bookService.findBy(pageable, searchParam.name, searchParam.bookType, searchParam.shopId).map(e -> BookDto.copy(e)); return ApiResult.build(bookDtoPage); }  @PostMapping(value = "/list") @Log(name = "图书管理", value = "查询图书") @ApiOperation(value = "查看图书列表", notes = "可以通过查询条件查询图书列表,包括分页信息") @ApiPageable ApiResult<Page<BookDto>> list(Pageable pageable, @RequestBody @Valid @ApiParam("查询参数") SearchBookParam searchParam, @ModelAttribute("user") User user) {; @PostMapping(value = "/list2") ApiResult<Stream<BookDto>> list2(Pageable pageable, @RequestBody(required = false) @Valid SearchBookParam searchParam, @ModelAttribute("user") User user); @PostMapping(value = "/add") @Log(name = "图书管理", value = "新增图书") ApiResult<?> add(@RequestBody @Valid AddBookParam param); @PostMapping(value = "/{id}") ApiResult<BookDto> show(@PathVariable("id") Book book, @ModelAttribute(name = "user", binding = false) User user); @PostMapping(value = "/update") @Log(name = "图书管理", value = "修改图书") ApiResult<?> update(@RequestBody @Valid UpdateBookParam param, @ModelAttribute("user") User user); @PostMapping(value = "/delete") @Log(name = "图书管理", value = "删除图书") ApiResult<?> delete(@RequestBody @Valid IdParam param);  }### Answer:
@Test public void testList() throws Exception { Book book1 = new Book(); book1.setBookType(BookTypeEnum.ECONOMIC); book1.setName("aaa"); book1.setId("001"); book1.setPage(100); book1.setPubDate(LocalDateTime.now()); List<Book> bookList = Arrays.asList(book1); Page<Book> page = new PageImpl<>(bookList); given(bookService.findBy(PageRequest.of(0, 20), "", null, "")).willReturn(page); String requestBody = "{\"name\":\"\", \"bookType\": null, \"shopId\":\"\"}"; mvc.perform(post("/book/list").header("token", TOKEN).contentType(MediaType.APPLICATION_JSON_UTF8).content(requestBody) .accept(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().isOk()).andExpect(jsonPath("$.code").value(1)).andExpect(jsonPath("$.data.content[0].name").value("aaa")); }