public static InfluxDBSinkConfig load(String yamlFile) throws IOException {
        ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
        return mapper.readValue(new File(yamlFile), InfluxDBSinkConfig.class);
    }
@Test
    public final void loadFromMapTest() throws IOException {
        Map<String, Object> map = new HashMap<>();
        map.put("influxdbUrl", "http://localhost:8086");
        map.put("database", "test_db");
        map.put("consistencyLevel", "ONE");
        map.put("logLevel", "NONE");
        map.put("retentionPolicy", "autogen");
        map.put("gzipEnable", "false");
        map.put("batchTimeMs", "1000");
        map.put("batchSize", "100");
        map.put("username", "admin");
        map.put("password", "admin");

        SinkContext sinkContext = Mockito.mock(SinkContext.class);
        InfluxDBSinkConfig config = InfluxDBSinkConfig.load(map, sinkContext);
        assertNotNull(config);
        assertEquals("http://localhost:8086", config.getInfluxdbUrl());
        assertEquals("test_db", config.getDatabase());
        assertEquals("ONE", config.getConsistencyLevel());
        assertEquals("NONE", config.getLogLevel());
        assertEquals("autogen", config.getRetentionPolicy());
        assertEquals(Boolean.parseBoolean("false"), config.isGzipEnable());
        assertEquals(Long.parseLong("1000"), config.getBatchTimeMs());
        assertEquals(Integer.parseInt("100"), config.getBatchSize());
        assertEquals("admin", config.getUsername());
        assertEquals("admin", config.getPassword());
    }