public static RedisSinkConfig load(String yamlFile) throws IOException {
        ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
        return mapper.readValue(new File(yamlFile), RedisSinkConfig.class);
    }
@Test
    public final void loadFromMapTest() throws IOException {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("redisHosts", "localhost:6379");
        map.put("redisPassword", "fake@123");
        map.put("redisDatabase", "1");
        map.put("clientMode", "Standalone");
        map.put("operationTimeout", "2000");
        map.put("batchSize", "100");
        map.put("batchTimeMs", "1000");
        map.put("connectTimeout", "3000");

        SinkContext sinkContext = Mockito.mock(SinkContext.class);
        RedisSinkConfig config = RedisSinkConfig.load(map, sinkContext);
        assertNotNull(config);
        assertEquals(config.getRedisHosts(), "localhost:6379");
        assertEquals(config.getRedisPassword(), "fake@123");
        assertEquals(config.getRedisDatabase(), Integer.parseInt("1"));
        assertEquals(config.getClientMode(), "Standalone");
        assertEquals(config.getOperationTimeout(), Long.parseLong("2000"));
        assertEquals(config.getBatchSize(), Integer.parseInt("100"));
        assertEquals(config.getBatchTimeMs(), Long.parseLong("1000"));
        assertEquals(config.getConnectTimeout(), Long.parseLong("3000"));
    }