use of com.netflix.simianarmy.aws.AWSResource in project SimianArmy by Netflix.
the class TestOrphanedELBRule method testMissingCountsCheckWithExtraFields.
@Test
public void testMissingCountsCheckWithExtraFields() {
DateTime now = DateTime.now();
Resource resource = new AWSResource().withId("test-elb").withResourceType(AWSResourceType.ELB).withOwnerEmail("owner@foo.com");
resource.setAdditionalField("bogusField1", "0");
resource.setAdditionalField("bogusField2", "0");
OrphanedELBRule rule = new OrphanedELBRule(new TestMonkeyCalendar(), 7);
Assert.assertTrue(rule.isValid(resource));
}
use of com.netflix.simianarmy.aws.AWSResource in project SimianArmy by Netflix.
the class TestTagValueExclusionRule method testExcludeTaggedResourceTagMatchOnly.
@Test
public void testExcludeTaggedResourceTagMatchOnly() {
Resource r1 = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE).withOwnerEmail("owner@foo.com");
r1.setTag("tag", null);
r1.setTag("tag1", "somethingelse");
r1.setTag("tag2", "somethingelse2");
TagValueExclusionRule rule = new TagValueExclusionRule(exclusionTags);
Assert.assertFalse(rule.isValid(r1));
}
use of com.netflix.simianarmy.aws.AWSResource in project SimianArmy by Netflix.
the class TestTagValueExclusionRule method testNameValueConstructor2.
@Test
public void testNameValueConstructor2() {
Resource r1 = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE).withOwnerEmail("owner@foo.com");
r1.setTag("tag1", "excludeme");
String names = "tag1,tag2";
String vals = "excludeme,excludeme2";
TagValueExclusionRule rule = new TagValueExclusionRule(names.split(","), vals.split(","));
Assert.assertTrue(rule.isValid(r1));
}
use of com.netflix.simianarmy.aws.AWSResource in project SimianArmy by Netflix.
the class TestTagValueExclusionRule method testExcludeTaggedResourceWithTagAndValueMatch1.
@Test
public void testExcludeTaggedResourceWithTagAndValueMatch1() {
Resource r1 = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE).withOwnerEmail("owner@foo.com");
r1.setTag("tag", null);
r1.setTag("tag1", "excludeme");
r1.setTag("tag2", "somethingelse");
TagValueExclusionRule rule = new TagValueExclusionRule(exclusionTags);
Assert.assertTrue(rule.isValid(r1));
}
use of com.netflix.simianarmy.aws.AWSResource in project SimianArmy by Netflix.
the class TestTagValueExclusionRule method testExcludeTaggedResourceValueMatchOnly.
@Test
public void testExcludeTaggedResourceValueMatchOnly() {
Resource r1 = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE).withOwnerEmail("owner@foo.com");
r1.setTag("tag", null);
r1.setTag("tagA", "excludeme");
r1.setTag("tagB", "excludeme2");
TagValueExclusionRule rule = new TagValueExclusionRule(exclusionTags);
Assert.assertFalse(rule.isValid(r1));
}
Aggregations