diff --git a/src/test/java/com/azure/cosmos/kafka/connect/source/CosmosDBSourceTaskTest.java b/src/test/java/com/azure/cosmos/kafka/connect/source/CosmosDBSourceTaskTest.java index 969b5333..90020b72 100644 --- a/src/test/java/com/azure/cosmos/kafka/connect/source/CosmosDBSourceTaskTest.java +++ b/src/test/java/com/azure/cosmos/kafka/connect/source/CosmosDBSourceTaskTest.java @@ -9,6 +9,7 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import org.mockito.Mockito; public class CosmosDBSourceTaskTest { + private final static String COSMOS_EMULATOR_KEY = "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="; + private final static String COSMOS_EMULATOR_HOST = "https://localhost:8081/"; private CosmosDBSourceTask testTask; private final String topicName = "testtopic"; private final String containerName = "container666"; @@ -96,9 +99,14 @@ public void setup() throws IllegalAccessException { } - @Test + @Test(expected = IllegalArgumentException.class) public void start() { - testTask = new CosmosDBSourceTask(); + CosmosDBSourceTask testTask = new CosmosDBSourceTask(); + HashMap configs = new HashMap<>(); + configs.put(CosmosDBSourceConfig.COSMOS_CONN_ENDPOINT_CONF, COSMOS_EMULATOR_HOST); + configs.put(CosmosDBSourceConfig.COSMOS_CONN_KEY_CONF, COSMOS_EMULATOR_KEY); + configs.put(CosmosDBSourceConfig.COSMOS_DATABASE_NAME_CONF, "mydb"); + configs.put(CosmosDBSourceConfig.COSMOS_CONTAINER_TOPIC_MAP_CONF, "mytopic5#mycontainer6"); testTask.start(sourceSettings); }