use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestSimpleDBRecorder method makeMockAWSClient.
private static AWSClient makeMockAWSClient() {
AmazonSimpleDB sdbMock = mock(AmazonSimpleDB.class);
AWSClient awsClient = mock(AWSClient.class);
when(awsClient.sdbClient()).thenReturn(sdbMock);
when(awsClient.region()).thenReturn("region");
return awsClient;
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestASGJanitorCrawler method testInstancesWithNullNames.
@Test
public void testInstancesWithNullNames() {
List<AutoScalingGroup> asgList = createASGList();
AWSClient awsMock = createMockAWSClient(asgList);
ASGJanitorCrawler crawler = new ASGJanitorCrawler(awsMock);
List<Resource> resources = crawler.resources();
verifyASGList(resources, asgList);
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestASGJanitorCrawler method createMockAWSClient.
private AWSClient createMockAWSClient(List<AutoScalingGroup> asgList, String... asgNames) {
AWSClient awsMock = mock(AWSClient.class);
when(awsMock.describeAutoScalingGroups(asgNames)).thenReturn(asgList);
when(awsMock.region()).thenReturn("us-east-1");
return awsMock;
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestASGOwnerEmailTag method createMockAWSClient.
private AWSClient createMockAWSClient(List<AutoScalingGroup> asgList, String... asgNames) {
AWSClient awsMock = mock(AWSClient.class);
when(awsMock.describeAutoScalingGroups(asgNames)).thenReturn(asgList);
return awsMock;
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestASGOwnerEmailTag method testForOwnerTag.
@Test
public void testForOwnerTag() {
Properties properties = new Properties();
BasicConformityMonkeyContext ctx = new BasicConformityMonkeyContext();
List<AutoScalingGroup> asgList = createASGList();
String[] asgNames = { ASG1, ASG2 };
AWSClient awsMock = createMockAWSClient(asgList, asgNames);
Map<String, AWSClient> regionToAwsClient = Maps.newHashMap();
regionToAwsClient.put("us-east-1", awsMock);
AWSClusterCrawler clusterCrawler = new AWSClusterCrawler(regionToAwsClient, new BasicConfiguration(properties));
List<Cluster> clusters = clusterCrawler.clusters(asgNames);
Assert.assertTrue(OWNER_TAG_VALUE.equalsIgnoreCase(clusters.get(0).getOwnerEmail()));
Assert.assertNull(clusters.get(1).getOwnerEmail());
}
Aggregations