use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestASGJanitorCrawler method testInstancesWithNames.
@Test
public void testInstancesWithNames() {
List<AutoScalingGroup> asgList = createASGList();
String[] asgNames = { "asg1", "asg2" };
AWSClient awsMock = createMockAWSClient(asgList, asgNames);
ASGJanitorCrawler crawler = new ASGJanitorCrawler(awsMock);
List<Resource> resources = crawler.resources(asgNames);
verifyASGList(resources, asgList);
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestASGJanitorCrawler method testInstancesWithResourceType.
@Test
public void testInstancesWithResourceType() {
List<AutoScalingGroup> asgList = createASGList();
AWSClient awsMock = createMockAWSClient(asgList);
ASGJanitorCrawler crawler = new ASGJanitorCrawler(awsMock);
for (AWSResourceType resourceType : AWSResourceType.values()) {
List<Resource> resources = crawler.resources(resourceType);
if (resourceType == AWSResourceType.ASG) {
verifyASGList(resources, asgList);
} else {
Assert.assertTrue(resources.isEmpty());
}
}
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestELBJanitorCrawler method testResourceTypes.
@Test
public void testResourceTypes() {
boolean includeInstances = false;
AWSClient client = createMockAWSClient();
addELBsToMock(client, createELBList(includeInstances));
ELBJanitorCrawler crawler = new ELBJanitorCrawler(client);
EnumSet<?> types = crawler.resourceTypes();
Assert.assertEquals(types.size(), 1);
Assert.assertEquals(types.iterator().next().name(), "ELB");
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestInstanceJanitorCrawler method testInstancesWithNullIds.
@Test
public void testInstancesWithNullIds() {
List<AutoScalingInstanceDetails> instanceDetailsList = createInstanceDetailsList();
List<Instance> instanceList = createInstanceList();
AWSClient awsMock = createMockAWSClient(instanceDetailsList, instanceList);
InstanceJanitorCrawler crawler = new InstanceJanitorCrawler(awsMock);
List<Resource> resources = crawler.resources();
verifyInstanceList(resources, instanceDetailsList);
}
use of com.netflix.simianarmy.client.aws.AWSClient in project SimianArmy by Netflix.
the class TestInstanceJanitorCrawler method testInstancesWithResourceType.
@Test
public void testInstancesWithResourceType() {
List<AutoScalingInstanceDetails> instanceDetailsList = createInstanceDetailsList();
List<Instance> instanceList = createInstanceList();
AWSClient awsMock = createMockAWSClient(instanceDetailsList, instanceList);
InstanceJanitorCrawler crawler = new InstanceJanitorCrawler(awsMock);
for (AWSResourceType resourceType : AWSResourceType.values()) {
List<Resource> resources = crawler.resources(resourceType);
if (resourceType == AWSResourceType.INSTANCE) {
verifyInstanceList(resources, instanceDetailsList);
} else {
Assert.assertTrue(resources.isEmpty());
}
}
}
Aggregations