use of org.apache.kafka.common.config.ConfigData in project kafka by apache.
the class FileConfigProviderTest method testGetOneKeyAtPath.
@Test
public void testGetOneKeyAtPath() throws Exception {
ConfigData configData = configProvider.get("dummy", Collections.singleton("testKey"));
Map<String, String> result = new HashMap<>();
result.put("testKey", "testResult");
assertEquals(result, configData.data());
assertNull(configData.ttl());
}
use of org.apache.kafka.common.config.ConfigData in project cruise-control by linkedin.
the class EnvConfigProviderTest method testNonExistingEnvReturnsEmpty.
@Test
public void testNonExistingEnvReturnsEmpty() {
Set<String> set = new HashSet<>();
set.add("NON_EXISTING_ENV");
ConfigData actual;
try (EnvConfigProvider configProvider = new EnvConfigProvider()) {
actual = configProvider.get("", set);
}
assertEquals(0, actual.data().size());
}
use of org.apache.kafka.common.config.ConfigData in project cruise-control by linkedin.
the class EnvConfigProviderTest method testExistingEnvReturnsValue.
@Test
public void testExistingEnvReturnsValue() {
String key = System.getenv().keySet().stream().findFirst().orElse("");
String expected = System.getenv(key);
Set<String> set = new HashSet<>();
set.add(key);
ConfigData actual;
try (EnvConfigProvider configProvider = new EnvConfigProvider()) {
actual = configProvider.get("", set);
}
assertEquals(expected, actual.data().get(key));
}
Aggregations