public static MongoSinkConfig load(String yamlFile) throws IOException {
        final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
        final MongoSinkConfig cfg = mapper.readValue(new File(yamlFile), MongoSinkConfig.class);

        return cfg;
    }
@Test
    public void testLoadMapConfig() throws IOException {
        final Map<String, Object> commonConfigMap = TestHelper.createCommonConfigMap();
        commonConfigMap.put("batchSize", TestHelper.BATCH_SIZE);
        commonConfigMap.put("batchTimeMs", TestHelper.BATCH_TIME);

        SinkContext sinkContext = Mockito.mock(SinkContext.class);
        final MongoSinkConfig cfg = MongoSinkConfig.load(commonConfigMap, sinkContext);

        assertEquals(cfg.getMongoUri(), TestHelper.URI);
        assertEquals(cfg.getDatabase(), TestHelper.DB);
        assertEquals(cfg.getCollection(), TestHelper.COLL);
        assertEquals(cfg.getBatchSize(), TestHelper.BATCH_SIZE);
        assertEquals(cfg.getBatchTimeMs(), TestHelper.BATCH_TIME);
    }