### Question:
ArticleController extends BaseController { @ApiOperation(value = "按照id修改", notes = "id") @PutMapping @OptLog(operationType = OptLogType.MODIFY, operationName = "修改文章") public JsonData<Void> updateByPrimaryKeySelective(@RequestBody @Validated ArticleDto articleDto, HttpServletRequest request) { Map<String, String> userInfo = getUserInfo(request); articleService.insertOrUpdateArticle(userInfo, articleDto); return JsonData.success(); } 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 testUpdateByPrimaryKeySelective() { JsonData<Void> result = articleController.updateByPrimaryKeySelective(new ArticleDto(), null); Assertions.assertEquals(new JsonData<Void>(true, 0, "message", any()), result); }