src/test/java/com/microsoft/azure/cosmosdb/kafka/connect/sink/SinkSettingsTest.java
@Test
    public void readGenericAndSpecific() {
        HashMap<String, String> source = new HashMap<>();
        //Add specific setting
        source.put(Settings.PREFIX + ".sink.post-processor", "foobar");
        source.put(Settings.PREFIX + ".task.buffer.size", "666");
        source.put(Settings.PREFIX + ".task.timeout", "444");
        source.put(Settings.PREFIX + ".task.pollinginterval", "787");
        source.put(Settings.PREFIX + ".containers.topicmap", "mytopic666#mycontainer555");
        SinkSettings sinkSettings = new SinkSettings();
        sinkSettings.populate(source);

        assertEquals("foobar", sinkSettings.getPostProcessor());
        assertEquals(444L, (long) sinkSettings.getTaskTimeout());
        assertEquals(666L, (long) sinkSettings.getTaskBufferSize());
        assertEquals("mytopic666", sinkSettings.getTopicContainerMap().getTopicForContainer("mycontainer555").get());
        assertEquals("mycontainer555", sinkSettings.getTopicContainerMap().getContainerForTopic("mytopic666").get());
    }
/**
     * Tests that both generic and specific values are properly populated
     */
Tests that both generic and specific values are properly populated
Tests that both generic and specific values are properly populated
@Test
    public void readGenericAndSpecific() {
        HashMap<String, String> source = new HashMap<>();
        source.put(Settings.PREFIX + ".sink.post-processor", "foobar");
        source.put(Settings.PREFIX + ".task.buffer.size", "666");
        source.put(Settings.PREFIX + ".task.timeout", "444");
        source.put(Settings.PREFIX + ".task.pollinginterval", "787");
        source.put(Settings.PREFIX + ".containers.topicmap", "mytopic666#mycontainer555");
        SinkSettings sinkSettings = new SinkSettings();
        sinkSettings.populate(source);
        assertEquals("foobar", sinkSettings.getPostProcessor());
        assertEquals(444L, (long) sinkSettings.getTaskTimeout());
        assertEquals(666L, (long) sinkSettings.getTaskBufferSize());
        assertEquals("mytopic666", sinkSettings.getTopicContainerMap().getTopicForContainer("mycontainer555").get());
        assertEquals("mycontainer555", sinkSettings.getTopicContainerMap().getContainerForTopic("mytopic666").get());
    }
@ Test public void readGenericAndSpecific ( ) { HashMap < String , String > source = new HashMap < > ( ) ; source . put ( Settings . PREFIX + ".sink.post-processor" , "foobar" ) ; source . put ( Settings . PREFIX + ".task.buffer.size" , "666" ) ; source . put ( Settings . PREFIX + ".task.timeout" , "444" ) ; source . put ( Settings . PREFIX + ".task.pollinginterval" , "787" ) ; source . put ( Settings . PREFIX + ".containers.topicmap" , "mytopic666#mycontainer555" ) ; SinkSettings sinkSettings = new SinkSettings ( ) ; sinkSettings . populate ( source ) ; assertEquals ( "foobar" , sinkSettings . getPostProcessor ( ) ) ; assertEquals ( 444L , ( long ) sinkSettings . getTaskTimeout ( ) ) ; assertEquals ( 666L , ( long ) sinkSettings . getTaskBufferSize ( ) ) ; assertEquals ( "mytopic666" , sinkSettings . getTopicContainerMap ( ) . getTopicForContainer ( "mycontainer555" ) . get ( ) ) ; assertEquals ( "mycontainer555" , sinkSettings . getTopicContainerMap ( ) . getContainerForTopic ( "mytopic666" ) . get ( ) ) ; }
Tests that both generic and specific values are properly populated
Tests that both generic and specific values are properly populated
//Add specific setting
