use of com.netflix.config.PollResult in project archaius by Netflix.
the class DynamoDbConfigurationSourceTest method testPoll.
@Test
public void testPoll() throws Exception {
AmazonDynamoDB mockBasicDbClient = mock(AmazonDynamoDB.class);
when(mockBasicDbClient.scan(any(ScanRequest.class))).thenReturn(DynamoDbMocks.basicScanResult1);
DynamoDbConfigurationSource testConfigSource = new DynamoDbConfigurationSource(mockBasicDbClient);
PollResult result = testConfigSource.poll(false, null);
assertEquals(3, result.getComplete().size());
assertEquals("bar", result.getComplete().get("foo"));
assertEquals("goo", result.getComplete().get("goo"));
assertEquals("who", result.getComplete().get("boo"));
}
use of com.netflix.config.PollResult in project archaius by Netflix.
the class DynamoDbDeploymentContextConfigurationSourceTest method testPoll.
@Test
public void testPoll() throws Exception {
DynamoDbDeploymentContextTableCache mockedCache = mock(DynamoDbDeploymentContextTableCache.class);
when(mockedCache.getProperties()).thenReturn(propCollection1, propCollection2);
DynamoDbDeploymentContextConfigurationSource testConfigSource = new DynamoDbDeploymentContextConfigurationSource(mockedCache, DeploymentContext.ContextKey.environment);
PollResult result = testConfigSource.poll(false, null);
assertEquals(3, result.getComplete().size());
assertEquals(result.getComplete().get("foo"), "bar");
assertEquals(result.getComplete().get("goo"), "goo");
assertEquals(result.getComplete().get("boo"), "who");
result = testConfigSource.poll(false, null);
assertEquals(3, result.getComplete().size());
assertEquals(result.getComplete().get("foo"), "bar");
assertEquals(result.getComplete().get("goo"), "boo");
assertEquals(result.getComplete().get("boo"), "who");
}
use of com.netflix.config.PollResult in project archaius by Netflix.
the class BlobStoreBackedConfigurationTest method testUpdate.
@Test
public void testUpdate() throws Exception {
BlobStoreConfigurationSource testConfigSource = new BlobStoreConfigurationSource(ctx);
PollResult result = testConfigSource.poll(true, null);
assertEquals(3, result.getComplete().size());
assertEquals("val1", result.getComplete().get("test1"));
assertEquals("val2", result.getComplete().get("test2"));
assertEquals("val3", result.getComplete().get("test3"));
update();
result = testConfigSource.poll(true, null);
assertEquals(3, result.getComplete().size());
assertEquals("vala", result.getComplete().get("test1"));
assertEquals("valb", result.getComplete().get("test2"));
assertEquals("valc", result.getComplete().get("test3"));
}
use of com.netflix.config.PollResult in project archaius by Netflix.
the class BlobStoreBackedConfigurationTest method testPoll.
@Test
public void testPoll() throws Exception {
BlobStoreConfigurationSource testConfigSource = new BlobStoreConfigurationSource(ctx);
PollResult result = testConfigSource.poll(true, null);
assertEquals(3, result.getComplete().size());
assertEquals("val1", result.getComplete().get("test1"));
assertEquals("val2", result.getComplete().get("test2"));
assertEquals("val3", result.getComplete().get("test3"));
}
use of com.netflix.config.PollResult in project java-chassis by ServiceComb.
the class TestYAMLConfigurationSource method testPullFromClassPath.
@Test
public void testPullFromClassPath() throws Exception {
YAMLConfigurationSource configSource = new YAMLConfigurationSource();
PollResult result = configSource.poll(true, null);
Map<String, Object> configMap = result.getComplete();
assertNotNull(configMap);
assertEquals(19, configMap.size());
assertNotNull(configMap.get("trace.handler.sampler.percent"));
assertEquals(0.5, configMap.get("trace.handler.sampler.percent"));
assertEquals("http://10.120.169.202:9980/", configMap.get("registry.client.serviceUrl.defaultZone"));
assertNull(configMap.get("eureka.client.serviceUrl.defaultZone"));
}
Aggregations