package org.apache.seatunnel.datasource.plugin.s3;

import org.apache.seatunnel.datasource.plugin.api.model.TableField;

import org.apache.hadoop.conf.Configuration;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static org.junit.jupiter.api.Assertions.*;

class HadoopS3AConfigurationTest {
    public static void main(String[] args) {

        Map<String, String> map = new HashMap<>();

        map.put("groupName", "测试s3适配器1");
        map.put("adapterId", "1714559639070314496");
        map.put("bucket", "ces");
        map.put("port", "9090");
        map.put("delimiter", ",");
        map.put("fs.s3a.endpoint", "http://192.168.1.174:9090/");
        map.put("fs.s3a.connection.ssl.enabled", "false");
        map.put(
                "fs.s3a.aws.credentials.provider",
                "org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider");
        map.put("hadoop_s3_properties", " ");
        map.put("access_key", "zyminio");
        map.put("secret_key", "zysoft123");
        Configuration configuration = HadoopS3AConfiguration.getConfiguration(map);
        //        List<String> databases = new S3DatasourceChannel().getDatabases("S3", map);
        //        System.out.println(databases+"-----------------------");
        //        List<String> tables = new S3DatasourceChannel().getTables("S3", map, "backup",
        // null);
        //        System.out.println(tables+"-----------------------");
        List<TableField> tableField =
                new S3DatasourceChannel().getTableFields("S3", map, "ces", "aa/bb/cc/ss.csv");
        System.out.println(tableField + "-----------------------");

        System.out.println(configuration);
    }
}
