@Override
    public void addDocInfo(final UpstreamInstance instance, final String docInfoJson, final String oldMd5, final Consumer<DocInfo> callback) {
        if (StringUtils.isEmpty(docInfoJson)) {
            return;
        }
        String newMd5 = DigestUtils.md5DigestAsHex(docInfoJson.getBytes(StandardCharsets.UTF_8));
        if (Objects.equals(newMd5, oldMd5)) {
            return;
        }
        DocInfo docInfo = getDocInfo(instance.getClusterName(), docInfoJson);
        if (Objects.isNull(docInfo) || CollectionUtils.isEmpty(docInfo.getDocModuleList())) {
            return;
        }
        docInfo.setDocMd5(newMd5);

        List<DocModule> docModules = docInfo.getDocModuleList();
        docModules.forEach(docModule -> docModule.getDocItems().forEach(docItem -> {
            ApiDocRegisterDTO build = ApiDocRegisterDTO.builder()
                .consume(this.getProduceConsume(docItem.getConsumes()))
                .produce(this.getProduceConsume(docItem.getProduces()))
                .httpMethod(this.getHttpMethod(docItem))
                .contextPath(docInfo.getContextPath())
                .ext(this.buildExtJson(instance, docItem))
                .document(JsonUtils.toJson(docItem))
                .rpcType(RpcTypeEnum.HTTP.getName())
                .version(API_DOC_VERSION)
                .apiDesc(docItem.getDescription())
                .tags(Collections.singletonList(docInfo.getContextPath()))
                .apiPath(docItem.getName())
                .apiSource(ApiSourceEnum.SWAGGER.getValue())
                .state(ApiStateEnum.UNPUBLISHED.getState())
                .apiOwner("admin")
                .eventType(EventType.REGISTER)
                .build();

            registerApiDocService.registerApiDocument(build);
        }));

        callback.accept(docInfo);
    }
@Test
    public void testAddDocInfo() {
        UpstreamInstance instance = new UpstreamInstance();
        instance.setContextPath("/testClusterName");
        AtomicBoolean atomicBoolean = new AtomicBoolean(false);
        docManager.addDocInfo(instance, SwaggerDocParserTest.DOC_INFO_JSON, "", docInfo -> {
            Assertions.assertEquals(docInfo.getTitle(), "shenyu-examples-http-swagger2 API");
            Assertions.assertEquals(docInfo.getClusterName(), "testClusterName");
            atomicBoolean.set(true);
        });

        Assertions.assertTrue(atomicBoolean.get());
    }