### Question:
CategoryController { @ApiOperation(value = "查询全部数据", notes = "id") @GetMapping public JsonData<Page<CategoryDto>> findCategoryByCondition(CategoryDto categoryDto, @PageableDefault(sort = "createAt", direction = DESC) Pageable pageable) { Page<CategoryDto> result = categoryService.findCategoryByCondition(categoryDto, pageable); return JsonData.success(result); } CategoryController(CategoryService categoryService); @ApiOperation(value = "查询全部数据", notes = "id") @GetMapping JsonData<Page<CategoryDto>> findCategoryByCondition(CategoryDto categoryDto,
	                                                           @PageableDefault(sort = "createAt", direction = DESC) Pageable pageable); @ApiOperation(value = "根据ID查询", notes = "id") @GetMapping(value = "/{id}") JsonData<CategoryDto> findCategoryByPrimaryKey(@PathVariable String id); @ApiOperation(value = "添加一条新的分类", notes = "id") @PostMapping @OptLog(operationType = OptLogType.ADD, operationName = "添加文章分类") JsonData<Void> insertCategory(@RequestBody @Validated CategoryDto categoryDto); @PutMapping @OptLog(operationType = OptLogType.MODIFY, operationName = "修改文章分类") @ApiOperation(value = "修改文章分类", notes = "id") JsonData<Void> updateByCategorySelective(@RequestBody @Validated CategoryDto categoryDto); @DeleteMapping // @OptLog(operationType = OptLogType.DELETE, operationName = "删除文章分类") @ApiOperation(value = "删除文章分类", notes = "id") JsonData<Void> deleteCategoryByIds(@RequestBody List<String> categoryIds);  }### Answer:
@Test void testFindCategoryByCondition() { when(categoryService.findCategoryByCondition(any(), any())).thenReturn(null); JsonData<Page<CategoryDto>> result = categoryController.findCategoryByCondition(new CategoryDto(), null); Assertions.assertEquals(new JsonData<Page<CategoryDto>>(true, 0, "message", any()), result); }