Search in sources :

Example 1 with BasicConformityMonkeyContext

use of com.netflix.simianarmy.basic.conformity.BasicConformityMonkeyContext 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());
}
Also used : AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) BasicConformityMonkeyContext(com.netflix.simianarmy.basic.conformity.BasicConformityMonkeyContext) Cluster(com.netflix.simianarmy.conformity.Cluster) AWSClient(com.netflix.simianarmy.client.aws.AWSClient) AWSClusterCrawler(com.netflix.simianarmy.aws.conformity.crawler.AWSClusterCrawler) Properties(java.util.Properties) BasicConfiguration(com.netflix.simianarmy.basic.BasicConfiguration) Test(org.testng.annotations.Test)

Aggregations

AutoScalingGroup (com.amazonaws.services.autoscaling.model.AutoScalingGroup)1 AWSClusterCrawler (com.netflix.simianarmy.aws.conformity.crawler.AWSClusterCrawler)1 BasicConfiguration (com.netflix.simianarmy.basic.BasicConfiguration)1 BasicConformityMonkeyContext (com.netflix.simianarmy.basic.conformity.BasicConformityMonkeyContext)1 AWSClient (com.netflix.simianarmy.client.aws.AWSClient)1 Cluster (com.netflix.simianarmy.conformity.Cluster)1 Properties (java.util.Properties)1 Test (org.testng.annotations.Test)1