diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/TestSimpleDBJanitorResourceTracker.java b/src/test/java/com/netflix/simianarmy/aws/janitor/TestSimpleDBJanitorResourceTracker.java index 754d1af6..d311b3cc 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/TestSimpleDBJanitorResourceTracker.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/TestSimpleDBJanitorResourceTracker.java @@ -68,7 +68,7 @@ public TestSimpleDBJanitorResourceTracker() { @Test public void testAddResource() { - String id = "i-1234567"; + String id = "i-12345678901234567"; AWSResourceType resourceType = AWSResourceType.INSTANCE; Resource.CleanupState state = Resource.CleanupState.MARKED; String description = "This is a test resource."; diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSSnapshotJanitorCrawler.java b/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSSnapshotJanitorCrawler.java index d10efe29..6b35f29a 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSSnapshotJanitorCrawler.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSSnapshotJanitorCrawler.java @@ -61,7 +61,7 @@ public void testSnapshotsWithNullIds() { public void testSnapshotsWithIds() { Date startTime = new Date(); List snapshotList = createSnapshotList(startTime); - String[] ids = {"snap-123456780", "snap-123456781"}; + String[] ids = {"snap-12345678901234567", "snap-12345678901234567"}; EBSSnapshotJanitorCrawler crawler = new EBSSnapshotJanitorCrawler(createMockAWSClient(snapshotList, ids)); List resources = crawler.resources(ids); verifySnapshotList(resources, snapshotList, startTime); @@ -107,8 +107,8 @@ private AWSClient createMockAWSClient(List snapshotList, String... ids private List createSnapshotList(Date startTime) { List snapshotList = new LinkedList(); - snapshotList.add(mkSnapshot("snap-123456780", startTime)); - snapshotList.add(mkSnapshot("snap-123456781", startTime)); + snapshotList.add(mkSnapshot("snap-12345678901234567", startTime)); + snapshotList.add(mkSnapshot("snap-12345678901234567", startTime)); return snapshotList; } diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSVolumeJanitorCrawler.java b/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSVolumeJanitorCrawler.java index e2b5e024..35a497d2 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSVolumeJanitorCrawler.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestEBSVolumeJanitorCrawler.java @@ -61,7 +61,7 @@ public void testVolumesWithNullIds() { public void testVolumesWithIds() { Date createTime = new Date(); List volumeList = createVolumeList(createTime); - String[] ids = {"vol-123456780", "vol-123456781"}; + String[] ids = {"vol-12345678901234567", "vol-12345678901234567"}; EBSVolumeJanitorCrawler crawler = new EBSVolumeJanitorCrawler(createMockAWSClient(volumeList, ids)); List resources = crawler.resources(ids); verifyVolumeList(resources, volumeList, createTime); @@ -107,8 +107,8 @@ private AWSClient createMockAWSClient(List volumeList, String... ids) { private List createVolumeList(Date createTime) { List volumeList = new LinkedList(); - volumeList.add(mkVolume("vol-123456780", createTime)); - volumeList.add(mkVolume("vol-123456781", createTime)); + volumeList.add(mkVolume("vol-12345678901234567", createTime)); + volumeList.add(mkVolume("vol-12345678901234567", createTime)); return volumeList; } diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestInstanceJanitorCrawler.java b/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestInstanceJanitorCrawler.java index 0d2119ba..5d21e703 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestInstanceJanitorCrawler.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/crawler/TestInstanceJanitorCrawler.java @@ -65,7 +65,7 @@ public void testInstancesWithNullIds() { public void testInstancesWithIds() { List instanceDetailsList = createInstanceDetailsList(); List instanceList = createInstanceList(); - String[] ids = {"i-123456780", "i-123456780"}; + String[] ids = {"i-12345678901234560", "i-12345678901234561"}; AWSClient awsMock = createMockAWSClient(instanceDetailsList, instanceList, ids); InstanceJanitorCrawler crawler = new InstanceJanitorCrawler(awsMock); List resources = crawler.resources(ids); @@ -125,8 +125,8 @@ private AWSClient createMockAWSClient(List instanceD private List createInstanceDetailsList() { List instanceList = new LinkedList(); - instanceList.add(mkInstanceDetails("i-123456780", "asg1")); - instanceList.add(mkInstanceDetails("i-123456781", "asg2")); + instanceList.add(mkInstanceDetails("i-12345678901234560", "asg1")); + instanceList.add(mkInstanceDetails("i-12345678901234561", "asg2")); return instanceList; } @@ -136,8 +136,8 @@ private AutoScalingInstanceDetails mkInstanceDetails(String instanceId, String a private List createInstanceList() { List instanceList = new LinkedList(); - instanceList.add(mkInstance("i-123456780")); - instanceList.add(mkInstance("i-123456781")); + instanceList.add(mkInstance("i-12345678901234560")); + instanceList.add(mkInstance("i-12345678901234561")); return instanceList; } diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestOldEmptyASGRule.java b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestOldEmptyASGRule.java index ccf75520..79a39467 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestOldEmptyASGRule.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestOldEmptyASGRule.java @@ -75,7 +75,7 @@ public void testASGWithInstances() { Resource resource = new AWSResource().withId("asg1").withResourceType(AWSResourceType.ASG); resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_LC_NAME, "launchConfig"); resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_MAX_SIZE, "2"); - resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_INSTANCES, "i-1,i-2"); + resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_INSTANCES, "123456789012345671,i-123456789012345672"); int launchConfiguAgeThreshold = 60; MonkeyCalendar calendar = new TestMonkeyCalendar(); DateTime now = new DateTime(calendar.now().getTimeInMillis()); @@ -180,7 +180,7 @@ public void testNullCalendar() { @Test public void testNonASGResource() { - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE); + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE); OldEmptyASGRule rule = new OldEmptyASGRule(new TestMonkeyCalendar(), 3, 60, new DummyASGInstanceValidator()); Assert.assertTrue(rule.isValid(resource)); Assert.assertNull(resource.getExpectedTerminationTime()); diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestSuspendedASGRule.java b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestSuspendedASGRule.java index 6f4b7141..574bbfc7 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestSuspendedASGRule.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/asg/TestSuspendedASGRule.java @@ -75,7 +75,7 @@ public void testEmptyASGSuspendedLessThanThreshold() { public void testASGWithInstances() { Resource resource = new AWSResource().withId("asg1").withResourceType(AWSResourceType.ASG); resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_MAX_SIZE, "2"); - resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_INSTANCES, "i-1,i-2"); + resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_INSTANCES, "123456789012345671,i-123456789012345672"); int suspensionAgeThreshold = 2; MonkeyCalendar calendar = new TestMonkeyCalendar(); DateTime now = new DateTime(calendar.now().getTimeInMillis()); @@ -177,7 +177,7 @@ public void testSuspensionTimeIncorrectFormat() { @Test public void testNonASGResource() { - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE); + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE); SuspendedASGRule rule = new SuspendedASGRule(new TestMonkeyCalendar(), 3, 2, new DummyASGInstanceValidator()); Assert.assertTrue(rule.isValid(resource)); Assert.assertNull(resource.getExpectedTerminationTime()); diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/generic/TestUntaggedRule.java b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/generic/TestUntaggedRule.java index c1725b0b..132c9084 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/generic/TestUntaggedRule.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/generic/TestUntaggedRule.java @@ -40,7 +40,7 @@ public class TestUntaggedRule { @Test public void testUntaggedInstanceWithOwner() { DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE) + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE) .withOwnerEmail("owner@foo.com"); resource.setTag("tag1", "value1"); ((AWSResource) resource).setAWSResourceState("running"); @@ -57,7 +57,7 @@ public void testUntaggedInstanceWithOwner() { @Test public void testUntaggedInstanceWithoutOwner() { DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE); + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE); resource.setTag("tag1", "value1"); ((AWSResource) resource).setAWSResourceState("running"); Set tags = new HashSet(); @@ -72,7 +72,7 @@ public void testUntaggedInstanceWithoutOwner() { @Test public void testTaggedInstance() { - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE); + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE); resource.setTag("tag1", "value1"); resource.setTag("tag2", "value2"); ((AWSResource) resource).setAWSResourceState("running"); @@ -90,7 +90,7 @@ public void testUntaggedResource() { DateTime now = DateTime.now(); Resource imageResource = new AWSResource().withId("ami-123123").withResourceType(AWSResourceType.IMAGE); Resource asgResource = new AWSResource().withId("my-cool-asg").withResourceType(AWSResourceType.ASG); - Resource ebsSnapshotResource = new AWSResource().withId("snap-123123").withResourceType(AWSResourceType.EBS_SNAPSHOT); + Resource ebsSnapshotResource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT); Resource lauchConfigurationResource = new AWSResource().withId("my-cool-launch-configuration").withResourceType(AWSResourceType.LAUNCH_CONFIG); Set tags = new HashSet(); tags.add("tag1"); @@ -113,7 +113,7 @@ public void testResourceWithExpectedTerminationTimeSet() { DateTime now = DateTime.now(); Date oldTermDate = new Date(now.plusDays(10).getMillis()); String oldTermReason = "Foo"; - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE) + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE) .withExpectedTerminationTime(oldTermDate) .withTerminationReason(oldTermReason); ((AWSResource) resource).setAWSResourceState("running"); diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/instance/TestOrphanedInstanceRule.java b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/instance/TestOrphanedInstanceRule.java index ffa95266..48ed0d94 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/instance/TestOrphanedInstanceRule.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/instance/TestOrphanedInstanceRule.java @@ -39,7 +39,7 @@ public class TestOrphanedInstanceRule { public void testOrphanedInstancesWithOwner() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE) + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())) .withOwnerEmail("owner@foo.com"); ((AWSResource) resource).setAWSResourceState("running"); @@ -55,7 +55,7 @@ public void testOrphanedInstancesWithOwner() { public void testOrphanedInstancesWithoutOwner() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE) + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("running"); int retentionDaysWithOwner = 4; @@ -69,7 +69,7 @@ public void testOrphanedInstancesWithoutOwner() { @Test public void testOrphanedInstancesWithoutLaunchTime() { int ageThreshold = 5; - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE); + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE); ((AWSResource) resource).setAWSResourceState("running"); int retentionDaysWithOwner = 4; int retentionDaysWithoutOwner = 8; @@ -83,7 +83,7 @@ public void testOrphanedInstancesWithoutLaunchTime() { public void testOrphanedInstancesWithLaunchTimeNotExpires() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE) + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE) .withLaunchTime(new Date(now.minusDays(ageThreshold - 1).getMillis())); ((AWSResource) resource).setAWSResourceState("running"); int retentionDaysWithOwner = 4; @@ -97,7 +97,7 @@ public void testOrphanedInstancesWithLaunchTimeNotExpires() { @Test public void testNonOrphanedInstances() { int ageThreshold = 5; - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE) + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE) .setAdditionalField(InstanceJanitorCrawler.INSTANCE_FIELD_ASG_NAME, "asg1"); ((AWSResource) resource).setAWSResourceState("running"); int retentionDaysWithOwner = 4; @@ -114,7 +114,7 @@ public void testResourceWithExpectedTerminationTimeSet() { Date oldTermDate = new Date(now.plusDays(10).getMillis()); String oldTermReason = "Foo"; int ageThreshold = 5; - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE) + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())) .withExpectedTerminationTime(oldTermDate) .withTerminationReason(oldTermReason); @@ -165,7 +165,7 @@ public void testNonInstanceResource() { @Test public void testNonRunningInstance() { - Resource resource = new AWSResource().withId("i-123").withResourceType(AWSResourceType.INSTANCE); + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE); ((AWSResource) resource).setAWSResourceState("stopping"); OrphanedInstanceRule rule = new OrphanedInstanceRule(new TestMonkeyCalendar(), 0, 0, 0); Assert.assertTrue(rule.isValid(resource)); diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/launchconfig/TestOldUnusedLaunchConfigRule.java b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/launchconfig/TestOldUnusedLaunchConfigRule.java index ed53ca74..75a23139 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/launchconfig/TestOldUnusedLaunchConfigRule.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/launchconfig/TestOldUnusedLaunchConfigRule.java @@ -145,7 +145,7 @@ public void testNullCalendar() { @Test public void testNonLaunchConfigResource() { - Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE); + Resource resource = new AWSResource().withId("i-12345678901234567").withResourceType(AWSResourceType.INSTANCE); OldUnusedLaunchConfigRule rule = new OldUnusedLaunchConfigRule(new TestMonkeyCalendar(), 3, 60); Assert.assertTrue(rule.isValid(resource)); Assert.assertNull(resource.getExpectedTerminationTime()); diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/snapshot/TestNoGeneratedAMIRule.java b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/snapshot/TestNoGeneratedAMIRule.java index ab7c1949..d5ffa03f 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/snapshot/TestNoGeneratedAMIRule.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/snapshot/TestNoGeneratedAMIRule.java @@ -48,7 +48,7 @@ public void testNonSnapshotResource() { @Test public void testUncompletedVolume() { - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT); + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT); ((AWSResource) resource).setAWSResourceState("stopped"); NoGeneratedAMIRule rule = new NoGeneratedAMIRule(new TestMonkeyCalendar(), 0, 0); Assert.assertTrue(rule.isValid(resource)); @@ -59,7 +59,7 @@ public void testUncompletedVolume() { public void testTaggedAsNotMark() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); int retentionDays = 4; @@ -74,7 +74,7 @@ public void testTaggedAsNotMark() { public void testUserSpecifiedTerminationDate() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); int retentionDays = 4; @@ -91,7 +91,7 @@ public void testUserSpecifiedTerminationDate() { public void testOldSnapshotWithoutAMI() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); int retentionDays = 4; @@ -105,7 +105,7 @@ public void testOldSnapshotWithoutAMI() { public void testSnapshotWithoutAMINotOld() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold - 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); int retentionDays = 4; @@ -119,7 +119,7 @@ public void testSnapshotWithoutAMINotOld() { public void testWithAMIs() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); resource.setAdditionalField(EBSSnapshotJanitorCrawler.SNAPSHOT_FIELD_AMIS, "ami-123"); @@ -133,7 +133,7 @@ public void testWithAMIs() { @Test public void testSnapshotsWithoutLauchTime() { int ageThreshold = 5; - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT); + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT); ((AWSResource) resource).setAWSResourceState("completed"); int retentionDays = 4; NoGeneratedAMIRule rule = new NoGeneratedAMIRule(new TestMonkeyCalendar(), @@ -147,7 +147,7 @@ public void testSnapshotsWithoutLauchTime() { public void testResourceWithExpectedTerminationTimeSet() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); Date oldTermDate = new Date(now.plusDays(10).getMillis()); @@ -166,7 +166,7 @@ public void testResourceWithExpectedTerminationTimeSet() { public void testOldSnapshotWithoutAMIWithOwnerOverride() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withOwnerEmail("owner@netflix.com").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withOwnerEmail("owner@netflix.com").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); int retentionDays = 4; @@ -181,7 +181,7 @@ public void testOldSnapshotWithoutAMIWithOwnerOverride() { public void testOldSnapshotWithoutAMIWithoutOwnerOverride() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("snap123").withOwnerEmail("owner@netflix.com").withResourceType(AWSResourceType.EBS_SNAPSHOT) + Resource resource = new AWSResource().withId("snap-12345678901234567").withOwnerEmail("owner@netflix.com").withResourceType(AWSResourceType.EBS_SNAPSHOT) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("completed"); int retentionDays = 4; diff --git a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/volume/TestOldDetachedVolumeRule.java b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/volume/TestOldDetachedVolumeRule.java index d106a2c4..eda2b594 100644 --- a/src/test/java/com/netflix/simianarmy/aws/janitor/rule/volume/TestOldDetachedVolumeRule.java +++ b/src/test/java/com/netflix/simianarmy/aws/janitor/rule/volume/TestOldDetachedVolumeRule.java @@ -57,7 +57,7 @@ public void testNonVolumeResource() { @Test public void testUnavailableVolume() { - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME); + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME); ((AWSResource) resource).setAWSResourceState("stopped"); OldDetachedVolumeRule rule = new OldDetachedVolumeRule(new TestMonkeyCalendar(), 0, 0); Assert.assertTrue(rule.isValid(resource)); @@ -68,7 +68,7 @@ public void testUnavailableVolume() { public void testTaggedAsNotMark() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); Date lastDetachTime = new Date(now.minusDays(ageThreshold + 1).getMillis()); @@ -86,7 +86,7 @@ public void testTaggedAsNotMark() { public void testNoMetaTag() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); int retentionDays = 4; @@ -101,7 +101,7 @@ public void testNoMetaTag() { public void testUserSpecifiedTerminationDate() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); int retentionDays = 4; @@ -118,7 +118,7 @@ public void testUserSpecifiedTerminationDate() { public void testOldDetachedVolume() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); Date lastDetachTime = new Date(now.minusDays(ageThreshold + 1).getMillis()); @@ -158,7 +158,7 @@ public void testOldDetachedVolumeBeforeDaylightSavingsCutover() { //here we set the create date to a few days before a known DST cutover, where //we observed DST failures DateTime closeToSpringAheadDst = new DateTime(2014, 3, 7, 0, 0, DateTimeZone.forID("America/Los_Angeles")); - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(closeToSpringAheadDst.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); Date lastDetachTime = new Date(closeToSpringAheadDst.minusDays(ageThreshold + 1).getMillis()); @@ -200,7 +200,7 @@ public void testOldDetachedVolumeBeforeDaylightSavingsCutover() { public void testDetachedVolumeNotOld() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); Date lastDetachTime = new Date(now.minusDays(ageThreshold - 1).getMillis()); @@ -217,10 +217,10 @@ public void testDetachedVolumeNotOld() { public void testAttachedVolume() { int ageThreshold = 5; DateTime now = DateTime.now(); - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); - String metaTag = VolumeTaggingMonkey.makeMetaTag("i-123", "owner", null); + String metaTag = VolumeTaggingMonkey.makeMetaTag("i-12345678901234567", "owner", null); resource.setTag(JanitorMonkey.JANITOR_META_TAG, metaTag); int retentionDays = 4; OldDetachedVolumeRule rule = new OldDetachedVolumeRule(new TestMonkeyCalendar(), @@ -236,7 +236,7 @@ public void testResourceWithExpectedTerminationTimeSet() { Date oldTermDate = new Date(now.plusDays(10).getMillis()); String oldTermReason = "Foo"; int ageThreshold = 5; - Resource resource = new AWSResource().withId("vol-123").withResourceType(AWSResourceType.EBS_VOLUME) + Resource resource = new AWSResource().withId("vol-12345678901234567").withResourceType(AWSResourceType.EBS_VOLUME) .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis())); ((AWSResource) resource).setAWSResourceState("available"); Date lastDetachTime = new Date(now.minusDays(ageThreshold + 1).getMillis()); diff --git a/src/test/java/com/netflix/simianarmy/basic/TestBasicContext.java b/src/test/java/com/netflix/simianarmy/basic/TestBasicContext.java index 70275b12..47fefaf5 100644 --- a/src/test/java/com/netflix/simianarmy/basic/TestBasicContext.java +++ b/src/test/java/com/netflix/simianarmy/basic/TestBasicContext.java @@ -71,13 +71,13 @@ public void testIsNotUsingProxyByDefault() { Assert.assertNull(awsClientConfig.getProxyPassword()); } - @Test + @Test public void testIsAbleToUseProxyByConfiguration() { BasicSimianArmyContext ctx = new BasicSimianArmyContext("proxy.properties"); ClientConfiguration awsClientConfig = ctx.getAwsClientConfig(); - Assert.assertEquals(awsClientConfig.getProxyHost(), "192.168.0.0"); + Assert.assertEquals(awsClientConfig.getProxyHost(), "127.0.0.1"); Assert.assertEquals(awsClientConfig.getProxyPort(), 80); Assert.assertEquals(awsClientConfig.getProxyUsername(), "fakeUser"); Assert.assertEquals(awsClientConfig.getProxyPassword(), "fakePassword"); diff --git a/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosEmailNotifier.java b/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosEmailNotifier.java index 01375a0b..9806d0a2 100644 --- a/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosEmailNotifier.java +++ b/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosEmailNotifier.java @@ -48,7 +48,7 @@ private enum GroupTypes implements GroupType { private String name = "name0"; private String region = "reg1"; private String to = "foo@bar.com"; - private String instanceId = "i-123456780"; + private String instanceId = "i-12345678901234567"; private String subjectPrefix = "Subject Prefix - "; private String subjectSuffix = " - Subject Suffix "; private String bodyPrefix = "Body Prefix - "; diff --git a/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosInstanceSelector.java b/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosInstanceSelector.java index 33c87839..fd470eda 100644 --- a/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosInstanceSelector.java +++ b/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosInstanceSelector.java @@ -62,8 +62,8 @@ public String region() { } public List instances() { - return Arrays.asList("i-123456780", "i-123456781", "i-123456782", "i-123456783", "i-123456784", - "i-123456785", "i-123456786", "i-123456787", "i-123456788", "i-123456789"); + return Arrays.asList("i-123456789012345670", "i-123456789012345671", "i-123456789012345672", "i-123456789012345673", "i-123456789012345674", + "i-123456789012345675", "i-123456789012345676", "i-123456789012345677", "i-123456789012345678", "i-123456789012345679"); } public void addInstance(String ignored) { diff --git a/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosMonkey.java b/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosMonkey.java index 99634a09..f4543a4a 100644 --- a/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosMonkey.java +++ b/src/test/java/com/netflix/simianarmy/basic/chaos/TestBasicChaosMonkey.java @@ -82,8 +82,8 @@ public void testUnleashedEnabledA() { Assert.assertEquals(selectedOn.get(1).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_A); Assert.assertEquals(selectedOn.get(1).name(), "name1"); Assert.assertEquals(terminated.size(), 2); - Assert.assertEquals(terminated.get(0), "0:i-123456780"); - Assert.assertEquals(terminated.get(1), "1:i-123456781"); + Assert.assertEquals(terminated.get(0), "0:i-123456789012345670"); + Assert.assertEquals(terminated.get(1), "1:i-123456789012345671"); } @Test @@ -116,8 +116,8 @@ public void testUnleashedEnabledB() { Assert.assertEquals(selectedOn.get(1).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_B); Assert.assertEquals(selectedOn.get(1).name(), "name3"); Assert.assertEquals(terminated.size(), 2); - Assert.assertEquals(terminated.get(0), "2:i-123456782"); - Assert.assertEquals(terminated.get(1), "3:i-123456783"); + Assert.assertEquals(terminated.get(0), "2:i-123456789012345672"); + Assert.assertEquals(terminated.get(1), "3:i-123456789012345673"); } @Test @@ -132,7 +132,7 @@ public void testEnabledAwithout1() { Assert.assertEquals(selectedOn.get(0).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_A); Assert.assertEquals(selectedOn.get(0).name(), "name0"); Assert.assertEquals(terminated.size(), 1); - Assert.assertEquals(terminated.get(0), "0:i-123456780"); + Assert.assertEquals(terminated.get(0), "0:i-123456789012345670"); } @Test @@ -147,7 +147,7 @@ public void testEnabledAwith0() { Assert.assertEquals(selectedOn.get(0).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_A); Assert.assertEquals(selectedOn.get(0).name(), "name0"); Assert.assertEquals(terminated.size(), 1); - Assert.assertEquals(terminated.get(0), "0:i-123456780"); + Assert.assertEquals(terminated.get(0), "0:i-123456789012345670"); } @Test @@ -168,10 +168,10 @@ public void testAll() { Assert.assertEquals(selectedOn.get(3).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_B); Assert.assertEquals(selectedOn.get(3).name(), "name3"); Assert.assertEquals(terminated.size(), 4); - Assert.assertEquals(terminated.get(0), "0:i-123456780"); - Assert.assertEquals(terminated.get(1), "1:i-123456781"); - Assert.assertEquals(terminated.get(2), "2:i-123456782"); - Assert.assertEquals(terminated.get(3), "3:i-123456783"); + Assert.assertEquals(terminated.get(0), "0:i-123456789012345670"); + Assert.assertEquals(terminated.get(1), "1:i-123456789012345671"); + Assert.assertEquals(terminated.get(2), "2:i-123456789012345672"); + Assert.assertEquals(terminated.get(3), "3:i-123456789012345673"); } @Test diff --git a/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyArmy.java b/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyArmy.java index dfd7de96..43d2f68e 100644 --- a/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyArmy.java +++ b/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyArmy.java @@ -83,9 +83,9 @@ private void checkSelected(TestChaosMonkeyContext ctx) { private void checkNotifications(TestChaosMonkeyContext ctx, String key) { List notifications = ctx.getGloballyNotifiedList(); Assert.assertEquals(notifications.size(), 2); - Assert.assertEquals(notifications.get(0).getInstance(), "0:i-123456780"); + Assert.assertEquals(notifications.get(0).getInstance(), "0:i-123456789012345670"); Assert.assertEquals(notifications.get(0).getChaosType().getKey(), key); - Assert.assertEquals(notifications.get(1).getInstance(), "1:i-123456781"); + Assert.assertEquals(notifications.get(1).getInstance(), "1:i-123456789012345671"); Assert.assertEquals(notifications.get(1).getChaosType().getKey(), key); } @@ -94,21 +94,21 @@ private void checkSshActions(TestChaosMonkeyContext ctx, String key) { Assert.assertEquals(sshActions.size(), 4); Assert.assertEquals(sshActions.get(0).getMethod(), "put"); - Assert.assertEquals(sshActions.get(0).getInstanceId(), "0:i-123456780"); + Assert.assertEquals(sshActions.get(0).getInstanceId(), "0:i-123456789012345670"); // We require that each script include the name of the chaos type // This makes testing easier, and also means the scripts show where they came from Assert.assertTrue(sshActions.get(0).getContents().toLowerCase().contains(key.toLowerCase())); Assert.assertEquals(sshActions.get(1).getMethod(), "exec"); - Assert.assertEquals(sshActions.get(1).getInstanceId(), "0:i-123456780"); + Assert.assertEquals(sshActions.get(1).getInstanceId(), "0:i-123456789012345670"); Assert.assertEquals(sshActions.get(2).getMethod(), "put"); - Assert.assertEquals(sshActions.get(2).getInstanceId(), "1:i-123456781"); + Assert.assertEquals(sshActions.get(2).getInstanceId(), "1:i-123456789012345671"); Assert.assertTrue(sshActions.get(2).getContents().contains(key)); Assert.assertEquals(sshActions.get(3).getMethod(), "exec"); - Assert.assertEquals(sshActions.get(3).getInstanceId(), "1:i-123456781"); + Assert.assertEquals(sshActions.get(3).getInstanceId(), "1:i-123456789012345671"); } @Test @@ -123,8 +123,8 @@ public void testShutdownInstance() { List terminated = ctx.terminated(); Assert.assertEquals(terminated.size(), 2); - Assert.assertEquals(terminated.get(0), "0:i-123456780"); - Assert.assertEquals(terminated.get(1), "1:i-123456781"); + Assert.assertEquals(terminated.get(0), "0:i-123456789012345670"); + Assert.assertEquals(terminated.get(1), "1:i-123456789012345671"); } @Test @@ -139,9 +139,9 @@ public void testBlockAllNetworkTraffic() { List cloudActions = ctx.getCloudActions(); Assert.assertEquals(cloudActions.size(), 3); - Assert.assertEquals(cloudActions.get(0), "createSecurityGroup:0:i-123456780:blocked-network"); - Assert.assertEquals(cloudActions.get(1), "setInstanceSecurityGroups:0:i-123456780:sg-1"); - Assert.assertEquals(cloudActions.get(2), "setInstanceSecurityGroups:1:i-123456781:sg-1"); + Assert.assertEquals(cloudActions.get(0), "createSecurityGroup:0:i-123456789012345670:blocked-network"); + Assert.assertEquals(cloudActions.get(1), "setInstanceSecurityGroups:0:i-123456789012345670:sg-1"); + Assert.assertEquals(cloudActions.get(2), "setInstanceSecurityGroups:1:i-123456789012345671:sg-1"); } @Test @@ -156,10 +156,10 @@ public void testDetachVolumes() { List cloudActions = ctx.getCloudActions(); Assert.assertEquals(cloudActions.size(), 4); - Assert.assertEquals(cloudActions.get(0), "detach:0:i-123456780:volume-1"); - Assert.assertEquals(cloudActions.get(1), "detach:0:i-123456780:volume-2"); - Assert.assertEquals(cloudActions.get(2), "detach:1:i-123456781:volume-1"); - Assert.assertEquals(cloudActions.get(3), "detach:1:i-123456781:volume-2"); + Assert.assertEquals(cloudActions.get(0), "detach:0:i-123456789012345670:volume-1"); + Assert.assertEquals(cloudActions.get(1), "detach:0:i-123456789012345670:volume-2"); + Assert.assertEquals(cloudActions.get(2), "detach:1:i-123456789012345671:volume-1"); + Assert.assertEquals(cloudActions.get(3), "detach:1:i-123456789012345671:volume-2"); } @Test diff --git a/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyContext.java b/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyContext.java index a74602a8..0277d47e 100644 --- a/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyContext.java +++ b/src/test/java/com/netflix/simianarmy/chaos/TestChaosMonkeyContext.java @@ -147,16 +147,16 @@ public EnumSet groupTypes() { @Override public List groups() { - InstanceGroup gA0 = new TestInstanceGroup(CrawlerTypes.TYPE_A, "name0", "reg1", "0:i-123456780"); - InstanceGroup gA1 = new TestInstanceGroup(CrawlerTypes.TYPE_A, "name1", "reg1", "1:i-123456781"); - InstanceGroup gB2 = new TestInstanceGroup(CrawlerTypes.TYPE_B, "name2", "reg1", "2:i-123456782"); - InstanceGroup gB3 = new TestInstanceGroup(CrawlerTypes.TYPE_B, "name3", "reg1", "3:i-123456783"); - InstanceGroup gC1 = new TestInstanceGroup(CrawlerTypes.TYPE_C, "name4", "reg1", "3:i-123456784", - "3:i-123456785"); - InstanceGroup gC2 = new TestInstanceGroup(CrawlerTypes.TYPE_C, "name5", "reg1", "3:i-123456786", - "3:i-123456787"); + InstanceGroup gA0 = new TestInstanceGroup(CrawlerTypes.TYPE_A, "name0", "reg1", "0:i-123456789012345670"); + InstanceGroup gA1 = new TestInstanceGroup(CrawlerTypes.TYPE_A, "name1", "reg1", "1:i-123456789012345671"); + InstanceGroup gB2 = new TestInstanceGroup(CrawlerTypes.TYPE_B, "name2", "reg1", "2:i-123456789012345672"); + InstanceGroup gB3 = new TestInstanceGroup(CrawlerTypes.TYPE_B, "name3", "reg1", "3:i-123456789012345673"); + InstanceGroup gC1 = new TestInstanceGroup(CrawlerTypes.TYPE_C, "name4", "reg1", "3:i-123456789012345674", + "3:i-123456789012345675"); + InstanceGroup gC2 = new TestInstanceGroup(CrawlerTypes.TYPE_C, "name5", "reg1", "3:i-123456789012345676", + "3:i-123456789012345677"); InstanceGroup gD0 = new TestInstanceGroup(CrawlerTypes.TYPE_D, "new-group-TestGroup1-XXXXXXXXX", - "reg1", "3:i-123456786", "3:i-123456787"); + "reg1", "3:i-123456789012345678", "3:i-123456789012345679"); return Arrays.asList(gA0, gA1, gB2, gB3, gC1, gC2, gD0); } diff --git a/src/test/java/com/netflix/simianarmy/client/aws/TestAWSClient.java b/src/test/java/com/netflix/simianarmy/client/aws/TestAWSClient.java index dad2b93b..72fc01ee 100644 --- a/src/test/java/com/netflix/simianarmy/client/aws/TestAWSClient.java +++ b/src/test/java/com/netflix/simianarmy/client/aws/TestAWSClient.java @@ -75,13 +75,13 @@ public void testTerminateInstance() { ArgumentCaptor arg = ArgumentCaptor.forClass(TerminateInstancesRequest.class); - this.terminateInstance("fake:i-123456789"); + this.terminateInstance("fake:i-12345678901234567"); verify(ec2Mock).terminateInstances(arg.capture()); List instances = arg.getValue().getInstanceIds(); Assert.assertEquals(instances.size(), 1); - Assert.assertEquals(instances.get(0), "fake:i-123456789"); + Assert.assertEquals(instances.get(0), "fake:i-12345678901234567"); } private DescribeAutoScalingGroupsResult mkAsgResult(String asgName, String instanceId) { @@ -97,9 +97,9 @@ private DescribeAutoScalingGroupsResult mkAsgResult(String asgName, String insta @Test public void testDescribeAutoScalingGroups() { - DescribeAutoScalingGroupsResult result1 = mkAsgResult("asg1", "i-012345670"); + DescribeAutoScalingGroupsResult result1 = mkAsgResult("asg1", "i-123456789012345670"); result1.setNextToken("nextToken"); - DescribeAutoScalingGroupsResult result2 = mkAsgResult("asg2", "i-012345671"); + DescribeAutoScalingGroupsResult result2 = mkAsgResult("asg2", "i-123456789012345671"); when(asgMock.describeAutoScalingGroups(any(DescribeAutoScalingGroupsRequest.class))).thenReturn(result1) .thenReturn(result2); @@ -113,10 +113,10 @@ public void testDescribeAutoScalingGroups() { // 2 asgs with 1 instance each Assert.assertEquals(asgs.get(0).getAutoScalingGroupName(), "asg1"); Assert.assertEquals(asgs.get(0).getInstances().size(), 1); - Assert.assertEquals(asgs.get(0).getInstances().get(0).getInstanceId(), "i-012345670"); + Assert.assertEquals(asgs.get(0).getInstances().get(0).getInstanceId(), "i-123456789012345670"); Assert.assertEquals(asgs.get(1).getAutoScalingGroupName(), "asg2"); Assert.assertEquals(asgs.get(1).getInstances().size(), 1); - Assert.assertEquals(asgs.get(1).getInstances().get(0).getInstanceId(), "i-012345671"); + Assert.assertEquals(asgs.get(1).getInstances().get(0).getInstanceId(), "i-123456789012345671"); } } diff --git a/src/test/java/com/netflix/simianarmy/client/aws/chaos/TestASGChaosCrawler.java b/src/test/java/com/netflix/simianarmy/client/aws/chaos/TestASGChaosCrawler.java index 33320641..e0ba9af5 100644 --- a/src/test/java/com/netflix/simianarmy/client/aws/chaos/TestASGChaosCrawler.java +++ b/src/test/java/com/netflix/simianarmy/client/aws/chaos/TestASGChaosCrawler.java @@ -70,8 +70,8 @@ public void testGroupTypes() { @Test public void testGroups() { List asgList = new LinkedList(); - asgList.add(mkAsg("asg1", "i-123456780")); - asgList.add(mkAsg("asg2", "i-123456781")); + asgList.add(mkAsg("asg1", "i-123456789012345670")); + asgList.add(mkAsg("asg2", "i-123456789012345671")); when(awsMock.describeAutoScalingGroups((String[]) null)).thenReturn(asgList); @@ -84,17 +84,17 @@ public void testGroups() { Assert.assertEquals(groups.get(0).type(), ASGChaosCrawler.Types.ASG); Assert.assertEquals(groups.get(0).name(), "asg1"); Assert.assertEquals(groups.get(0).instances().size(), 1); - Assert.assertEquals(groups.get(0).instances().get(0), "i-123456780"); + Assert.assertEquals(groups.get(0).instances().get(0), "i-123456789012345670"); Assert.assertEquals(groups.get(1).type(), ASGChaosCrawler.Types.ASG); Assert.assertEquals(groups.get(1).name(), "asg2"); Assert.assertEquals(groups.get(1).instances().size(), 1); - Assert.assertEquals(groups.get(1).instances().get(0), "i-123456781"); + Assert.assertEquals(groups.get(1).instances().get(0), "i-123456789012345671"); } @Test public void testFindAggressionCoefficient() { - AutoScalingGroup asg1 = mkAsg("asg1", "i-123456780"); + AutoScalingGroup asg1 = mkAsg("asg1", "i-123456789012345670"); Set tagDescriptions = new HashSet<>(); tagDescriptions.add(makeTunableTag("1.0")); asg1.setTags(tagDescriptions); @@ -106,7 +106,7 @@ public void testFindAggressionCoefficient() { @Test public void testFindAggressionCoefficient_two() { - AutoScalingGroup asg1 = mkAsg("asg1", "i-123456780"); + AutoScalingGroup asg1 = mkAsg("asg1", "i-123456789012345670"); Set tagDescriptions = new HashSet<>(); tagDescriptions.add(makeTunableTag("2.0")); asg1.setTags(tagDescriptions); @@ -118,7 +118,7 @@ public void testFindAggressionCoefficient_two() { @Test public void testFindAggressionCoefficient_null() { - AutoScalingGroup asg1 = mkAsg("asg1", "i-123456780"); + AutoScalingGroup asg1 = mkAsg("asg1", "i-123456789012345670"); Set tagDescriptions = new HashSet<>(); tagDescriptions.add(makeTunableTag(null)); asg1.setTags(tagDescriptions); @@ -130,7 +130,7 @@ public void testFindAggressionCoefficient_null() { @Test public void testFindAggressionCoefficient_unparsable() { - AutoScalingGroup asg1 = mkAsg("asg1", "i-123456780"); + AutoScalingGroup asg1 = mkAsg("asg1", "i-123456789012345670"); Set tagDescriptions = new HashSet<>(); tagDescriptions.add(makeTunableTag("not a number")); asg1.setTags(tagDescriptions); @@ -149,7 +149,7 @@ private TagDescription makeTunableTag(String value) { @Test public void testGetInstanceGroup_basic() { - AutoScalingGroup asg = mkAsg("asg1", "i-123456780"); + AutoScalingGroup asg = mkAsg("asg1", "i-123456789012345670"); InstanceGroup group = crawler.getInstanceGroup(asg, 1.0); @@ -159,7 +159,7 @@ public void testGetInstanceGroup_basic() { @Test public void testGetInstanceGroup_tunable() { - AutoScalingGroup asg = mkAsg("asg1", "i-123456780"); + AutoScalingGroup asg = mkAsg("asg1", "i-123456789012345670"); InstanceGroup group = crawler.getInstanceGroup(asg, 2.0); diff --git a/src/test/java/com/netflix/simianarmy/resources/chaos/TestChaosMonkeyResource.java b/src/test/java/com/netflix/simianarmy/resources/chaos/TestChaosMonkeyResource.java index ed0f4b15..8c7c5dbc 100644 --- a/src/test/java/com/netflix/simianarmy/resources/chaos/TestChaosMonkeyResource.java +++ b/src/test/java/com/netflix/simianarmy/resources/chaos/TestChaosMonkeyResource.java @@ -177,7 +177,7 @@ public void testResource() { Map anyMap = anyMap(); when(mockRecorder.findEvents(any(MonkeyType.class), any(EventType.class), anyMap, any(Date.class))).thenReturn( - Arrays.asList(mkEvent("i-1234356780"), mkEvent("i-123456781"))); + Arrays.asList(mkEvent("i-123456789012345670"), mkEvent("i-123456789012345671"))); try { Response resp = resource.getChaosEvents(mockUriInfo); diff --git a/src/test/resources/com/netflix/simianarmy/resources/chaos/getChaosEventsResponse.json b/src/test/resources/com/netflix/simianarmy/resources/chaos/getChaosEventsResponse.json index 7cf4a799..4dd4fa8e 100644 --- a/src/test/resources/com/netflix/simianarmy/resources/chaos/getChaosEventsResponse.json +++ b/src/test/resources/com/netflix/simianarmy/resources/chaos/getChaosEventsResponse.json @@ -1 +1 @@ -[{"monkeyType":"CHAOS","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup","instanceId":"i-1234356780"},{"monkeyType":"CHAOS","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup","instanceId":"i-123456781"}] \ No newline at end of file +[{"monkeyType":"CHAOS","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup","instanceId":"i-123456789012345670"},{"monkeyType":"CHAOS","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup","instanceId":"i-123456789012345671"}] \ No newline at end of file diff --git a/src/test/resources/proxy.properties b/src/test/resources/proxy.properties index 404ef853..cc49d6ac 100644 --- a/src/test/resources/proxy.properties +++ b/src/test/resources/proxy.properties @@ -1,5 +1,5 @@ # Proxy configuration for the purpose of testing -simianarmy.client.aws.proxyHost=192.168.0.0 +simianarmy.client.aws.proxyHost=127.0.0.1 simianarmy.client.aws.proxyPort=80 simianarmy.client.aws.proxyUser=fakeUser simianarmy.client.aws.proxyPassword=fakePassword