public static SolrSinkConfig load(String yamlFile) throws IOException {
        ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
        return mapper.readValue(new File(yamlFile), SolrSinkConfig.class);
    }
@Test
    public final void loadFromMapTest() throws IOException {
        Map<String, Object> map = new HashMap<>();
        map.put("solrUrl", "localhost:2181,localhost:2182/chroot");
        map.put("solrMode", "SolrCloud");
        map.put("solrCollection", "techproducts");
        map.put("solrCommitWithinMs", "100");
        map.put("username", "fakeuser");
        map.put("password", "fake@123");

        SinkContext sinkContext = Mockito.mock(SinkContext.class);
        SolrSinkConfig config = SolrSinkConfig.load(map, sinkContext);
        assertNotNull(config);
        assertEquals(config.getSolrUrl(), "localhost:2181,localhost:2182/chroot");
        assertEquals(config.getSolrMode(), "SolrCloud");
        assertEquals(config.getSolrCollection(), "techproducts");
        assertEquals(config.getSolrCommitWithinMs(), Integer.parseInt("100"));
        assertEquals(config.getUsername(), "fakeuser");
        assertEquals(config.getPassword(), "fake@123");
    }