Search in sources :

Example 1 with ConfigData

use of org.apache.kafka.common.config.ConfigData in project kafka by apache.

the class FileConfigProviderTest method testNullPathWithKey.

@Test
public void testNullPathWithKey() throws Exception {
    ConfigData configData = configProvider.get(null, Collections.singleton("testKey"));
    assertTrue(configData.data().isEmpty());
    assertNull(configData.ttl());
}
Also used : ConfigData(org.apache.kafka.common.config.ConfigData) Test(org.junit.jupiter.api.Test)

Example 2 with ConfigData

use of org.apache.kafka.common.config.ConfigData in project kafka by apache.

the class FileConfigProviderTest method testGetAllKeysAtPath.

@Test
public void testGetAllKeysAtPath() throws Exception {
    ConfigData configData = configProvider.get("dummy");
    Map<String, String> result = new HashMap<>();
    result.put("testKey", "testResult");
    result.put("testKey2", "testResult2");
    assertEquals(result, configData.data());
    assertNull(configData.ttl());
}
Also used : HashMap(java.util.HashMap) ConfigData(org.apache.kafka.common.config.ConfigData) Test(org.junit.jupiter.api.Test)

Example 3 with ConfigData

use of org.apache.kafka.common.config.ConfigData in project kafka by apache.

the class FileConfigProviderTest method testEmptyPathWithKey.

@Test
public void testEmptyPathWithKey() throws Exception {
    ConfigData configData = configProvider.get("");
    assertTrue(configData.data().isEmpty());
    assertNull(configData.ttl());
}
Also used : ConfigData(org.apache.kafka.common.config.ConfigData) Test(org.junit.jupiter.api.Test)

Example 4 with ConfigData

use of org.apache.kafka.common.config.ConfigData in project kafka by apache.

the class FileConfigProviderTest method testEmptyPath.

@Test
public void testEmptyPath() throws Exception {
    ConfigData configData = configProvider.get("", Collections.singleton("testKey"));
    assertTrue(configData.data().isEmpty());
    assertNull(configData.ttl());
}
Also used : ConfigData(org.apache.kafka.common.config.ConfigData) Test(org.junit.jupiter.api.Test)

Example 5 with ConfigData

use of org.apache.kafka.common.config.ConfigData in project kafka by apache.

the class FileConfigProviderTest method testNullPath.

@Test
public void testNullPath() throws Exception {
    ConfigData configData = configProvider.get(null);
    assertTrue(configData.data().isEmpty());
    assertNull(configData.ttl());
}
Also used : ConfigData(org.apache.kafka.common.config.ConfigData) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigData (org.apache.kafka.common.config.ConfigData)18 Test (org.junit.jupiter.api.Test)14 HashMap (java.util.HashMap)4 IOException (java.io.IOException)2 Reader (java.io.Reader)2 HashSet (java.util.HashSet)2 Properties (java.util.Properties)2 ConfigException (org.apache.kafka.common.config.ConfigException)2 Test (org.junit.Test)2