### Question:
ArticleController extends BaseController { @ApiOperation(value = "查询文章集合", notes = "Article") @GetMapping public JsonData<Page<ArticleDto>> findArticleByCondition(ArticleDto articleDto, @PageableDefault(sort = "createAt", direction = DESC) Pageable pageable) { Page<ArticleDto> result = articleService.findArticleByCondition(articleDto, pageable); return JsonData.success(result); } ArticleController(ArticleService articleService, OssClientUtil ossClientUtil); @ApiOperation(value = "查询文章集合", notes = "Article") @GetMapping JsonData<Page<ArticleDto>> findArticleByCondition(ArticleDto articleDto,
	                                                         @PageableDefault(sort = "createAt", direction = DESC) Pageable pageable); @ApiOperation(value = "按照id查询文章", notes = "id") @GetMapping(value = "/{id}") JsonData<ArticleDto> findArticleById(@PathVariable String id); @ApiOperation(value = "添加一条新的文章") @PostMapping // @OptLog(operationType = OptLogType.ADD, operationName = "添加一条新的文章") JsonData<Map<String, String>> insertArticle(@RequestBody @Validated ArticleDto articleDto, HttpServletRequest request); @ApiOperation(value = "上传文章封面") @PutMapping("/thumb") // @OptLog(operationType = OptLogType.ADD, operationName = "上传文章封面") JsonData<String> updateThumb(MultipartFile file); @ApiOperation(value = "按照id修改", notes = "id") @PutMapping @OptLog(operationType = OptLogType.MODIFY, operationName = "修改文章") JsonData<Void> updateByPrimaryKeySelective(@RequestBody @Validated ArticleDto articleDto, HttpServletRequest request); @ApiOperation(value = "删除", notes = "id") @DeleteMapping @OptLog(operationType = OptLogType.DELETE, operationName = "删除文章") JsonData<Void> deleteArticleByIds(@RequestBody List<String> articleIds); @ApiOperation(value = "审核当前文章", notes = "id") @PutMapping(value = "/examine/{id}") JsonData<Void> examine(@PathVariable String id);  }### Answer:
@Test void testFindArticleByCondition() throws Exception { ArticleDto article = new ArticleDto(); article.setId("1"); Page<ArticleDto> page = new PageImpl<>(Arrays.asList(article)); when(articleService.findArticleByCondition(any(), any())).thenReturn(page); ResultActions resultActions = mockMvc.perform(get("/article").accept(MediaType.APPLICATION_JSON)); resultActions.andDo(print()).andExpect(status().isOk()) .andExpect(jsonPath("$.data.content", hasSize(1))); MockHttpServletResponse response = resultActions.andReturn().getResponse(); String attributeNames = response.getContentAsString(); JsonData jsonData = JsonUtil.jsonToPojo(attributeNames, JsonData.class); System.out.println(jsonData); String a = "hahaha"; int aValue = 9; verify(articleService, times(1)).findArticleByCondition(any(), any()); verifyNoMoreInteractions(articleService); }