use of com.netflix.config.PollResult in project archaius by Netflix.
the class S3ConfigurationSourceTest method testPoll_fileNotFound.
@Test(expected = AmazonServiceException.class)
public void testPoll_fileNotFound() throws Exception {
S3ConfigurationSource instance = new S3ConfigurationSource(client, "bucketname", "404.txt");
PollResult result = instance.poll(INITIAL, CHECK_POINT);
assertNotNull(result);
assertEquals("true", result.getComplete().get("loaded"));
assertEquals(1, result.getComplete().size());
}
use of com.netflix.config.PollResult in project archaius by Netflix.
the class S3ConfigurationSourceTest method testPoll_shouldLoadSomeData.
@Test
public void testPoll_shouldLoadSomeData() throws Exception {
S3ConfigurationSource instance = new S3ConfigurationSource(client, "bucketname", "standard-key.txt");
PollResult result = instance.poll(INITIAL, CHECK_POINT);
assertNotNull(result);
assertEquals("true", result.getComplete().get("loaded"));
assertEquals(1, result.getComplete().size());
}
use of com.netflix.config.PollResult in project archaius by Netflix.
the class DynamoDbConfigurationSourceIntegrationTest method testPoll.
//@Test
public void testPoll() throws Exception {
if (dbClient != null) {
DynamoDbConfigurationSource testConfigSource = new DynamoDbConfigurationSource();
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 archaius by Netflix.
the class DynamoDbConfigurationSourceIntegrationTest method testUpdate.
//@Test
public void testUpdate() throws Exception {
if (dbClient != null) {
DynamoDbConfigurationSource testConfigSource = new DynamoDbConfigurationSource();
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"));
updateValues(dbClient, tableName);
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 DynamoDbConfigurationSourceTest method testUpdate.
@Test
public void testUpdate() throws Exception {
AmazonDynamoDB mockBasicDbClient = mock(AmazonDynamoDB.class);
when(mockBasicDbClient.scan(any(ScanRequest.class))).thenReturn(DynamoDbMocks.basicScanResult1, DynamoDbMocks.basicScanResult2);
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"));
result = testConfigSource.poll(false, null);
assertEquals(3, result.getComplete().size());
assertEquals("bar", result.getComplete().get("foo"));
assertEquals("foo", result.getComplete().get("goo"));
assertEquals("who", result.getComplete().get("boo"));
}
Aggregations