@Test
    public void testGetMappingInfo() throws Exception {
        final String indexName = "test_get_mapping_info";
        final List<ElasticsearchFieldInfo> fieldInfos = new ArrayList<>();
        final ElasticsearchFieldInfo count = new ElasticsearchFieldInfo();
        count.setFieldType("double");
        count.setFieldName("count");
        fieldInfos.add(count);
        final ElasticsearchFieldInfo date = new ElasticsearchFieldInfo();
        date.setFieldType("date");
        date.setFieldName("date");
        date.setFieldFormat("yyyy-MM-dd HH:mm:ss||yyy-MM-dd||epoch_millis");
        fieldInfos.add(date);
        final ElasticsearchFieldInfo delay = new ElasticsearchFieldInfo();
        delay.setFieldType("double");
        delay.setFieldName("delay");
        fieldInfos.add(delay);
        final ElasticsearchFieldInfo inlong_group_id = new ElasticsearchFieldInfo();
        inlong_group_id.setFieldType("text");
        inlong_group_id.setFieldName("inlong_group_id");
        fieldInfos.add(inlong_group_id);
        final ElasticsearchFieldInfo inlong_stream_id = new ElasticsearchFieldInfo();
        inlong_stream_id.setFieldType("text");
        inlong_stream_id.setFieldName("inlong_stream_id");
        fieldInfos.add(inlong_stream_id);
        final ElasticsearchFieldInfo log_ts = new ElasticsearchFieldInfo();
        log_ts.setFieldType("keyword");
        log_ts.setFieldName("log_ts");
        fieldInfos.add(log_ts);
        elasticsearchApi.createIndexAndMapping(indexName, fieldInfos);
        Map<String, ElasticsearchFieldInfo> result = elasticsearchApi.getMappingMap(indexName);
        assertEquals("double", result.get("count").getFieldType());
        assertEquals("double", result.get("delay").getFieldType());
        assertEquals("date", result.get("date").getFieldType());
        assertEquals("yyyy-MM-dd HH:mm:ss||yyy-MM-dd||epoch_millis", result.get("date").getFieldFormat());
        assertEquals("text", result.get("inlong_stream_id").getFieldType());
        assertEquals("text", result.get("inlong_group_id").getFieldType());
        assertEquals("keyword", result.get("log_ts").getFieldType());
    }
Test cases for {@link ElasticsearchApi#getMappingMap(String)}.

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