### Question:
CommentController { @GetMapping(value = "/{id}") @ApiOperation(value = "根据ID查询", notes = "Comment") public JsonData<CommentDto> findCommentByPrimaryKey(@PathVariable String id) { CommentDto result = commentService.findCommentByPrimaryKey(id); return JsonData.success(result); } CommentController(CommentService commentService); @GetMapping() @ApiOperation(value = "查询文章评论", notes = "Comment") JsonData<Page<CommentDto>> findCommentByCondition(CommentDto commentDto,
	                                                         @PageableDefault(sort = "createAt", direction = DESC) Pageable pageable); @GetMapping(value = "/{id}") @ApiOperation(value = "根据ID查询", notes = "Comment") JsonData<CommentDto> findCommentByPrimaryKey(@PathVariable String id); @PostMapping() @OptLog(operationType = OptLogType.ADD, operationName = "增加文章评论") @ApiOperation(value = "增加文章评论", notes = "Comment") JsonData<Void> insertComment(@RequestBody @Validated CommentDto commentDto); @PutMapping @OptLog(operationType = OptLogType.MODIFY, operationName = "修改文章评论") @ApiOperation(value = "修改文章评论", notes = "Comment") JsonData<Void> updateByCommentSelective(@RequestBody @Validated CommentDto commentDto); @DeleteMapping @OptLog(operationType = OptLogType.DELETE, operationName = "删除评论") @ApiOperation(value = "删除", notes = "Comment") JsonData<Void> deleteByIds(List<String> commentIds);  }### Answer:
@Test void testFindCommentByPrimaryKey() { when(commentService.findCommentByPrimaryKey(anyString())).thenReturn(new CommentDto()); JsonData<CommentDto> result = commentController.findCommentByPrimaryKey("id"); Assertions.assertEquals(new JsonData<CommentDto>(true, 0, "message", any()), result); }