@Test
    public void testAddFields() throws Exception {
        final String indexName = "test_add_fields";
        final List<ElasticsearchFieldInfo> fieldInfos = new ArrayList<>();
        final ElasticsearchFieldInfo count = new ElasticsearchFieldInfo();
        count.setFieldType("double");
        count.setFieldName("count");
        fieldInfos.add(count);
        elasticsearchApi.createIndexAndMapping(indexName, fieldInfos);

        final List<ElasticsearchFieldInfo> addFieldInfos = new ArrayList<>();
        final ElasticsearchFieldInfo log_ts = new ElasticsearchFieldInfo();
        log_ts.setFieldType("keyword");
        log_ts.setFieldName("log_ts");
        addFieldInfos.add(log_ts);
        elasticsearchApi.addFields(indexName, addFieldInfos);

        Map<String, ElasticsearchFieldInfo> result = elasticsearchApi.getMappingMap(indexName);
        assertEquals("double", result.get("count").getFieldType());
        assertEquals("keyword", result.get("log_ts").getFieldType());
    }
Test cases for {@link ElasticsearchApi#addFields(String, List)}.

@throws Exception
inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/sink/ElasticsearchApiTest.java