Package com.netflix.simianarmy.client.aws

Examples of com.netflix.simianarmy.client.aws.AWSClient


// CHECKSTYLE IGNORE MagicNumberCheck
public class TestSimpleDBRecorder extends SimpleDBRecorder {

    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;
    }
View Full Code Here


*/
public class TestVSphereContext {
    @Test
    public void shouldSetClientOfCorrectType() {
        VSphereContext context = new VSphereContext();
        AWSClient awsClient = context.awsClient();
        assertNotNull(awsClient);
        assertTrue(awsClient instanceof VSphereClient);
    }
View Full Code Here

    }

    @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);
    }
View Full Code Here

    @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);
    }
View Full Code Here

    }

    @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);
View Full Code Here

        Assert.assertEquals(asg.getAdditionalField(ASGJanitorCrawler.ASG_FIELD_SUSPENSION_TIME),
                "2012-12-03T23:00:03");
    }

    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;
    }
View Full Code Here

        }
    }

    private AWSClient createMockAWSClient(List<AutoScalingGroup> asgList,
                                          List<LaunchConfiguration> lcList, String... lcNames) {
        AWSClient awsMock = mock(AWSClient.class);
        when(awsMock.describeAutoScalingGroups()).thenReturn(asgList);
        when(awsMock.describeLaunchConfigurations(lcNames)).thenReturn(lcList);
        when(awsMock.region()).thenReturn("us-east-1");
        return awsMock;
    }
View Full Code Here

public class TestSimpleDBJanitorResourceTracker extends SimpleDBJanitorResourceTracker {

    private static AWSClient makeMockAWSClient() {
        AmazonSimpleDB sdbMock = mock(AmazonSimpleDB.class);
        AWSClient awsClient = mock(AWSClient.class);
        when(awsClient.sdbClient()).thenReturn(sdbMock);
        return awsClient;
    }
View Full Code Here

        Assert.assertEquals(((AWSResource) volume).getAWSResourceState(), "available");
        Assert.assertEquals(volume.getLaunchTime(), createTime);
    }

    private AWSClient createMockAWSClient(List<Volume> volumeList, String... ids) {
        AWSClient awsMock = mock(AWSClient.class);
        when(awsMock.describeVolumes(ids)).thenReturn(volumeList);
        when(awsMock.region()).thenReturn("us-east-1");
        return awsMock;
    }
View Full Code Here

        Assert.assertEquals(((AWSResource) snapshot).getAWSResourceState(), "completed");
        Assert.assertEquals(snapshot.getLaunchTime(), startTime);
    }

    private AWSClient createMockAWSClient(List<Snapshot> snapshotList, String... ids) {
        AWSClient awsMock = mock(AWSClient.class);
        when(awsMock.describeSnapshots(ids)).thenReturn(snapshotList);
        when(awsMock.region()).thenReturn("us-east-1");
        return awsMock;
    }
View Full Code Here

TOP

Related Classes of com.netflix.simianarmy.client.aws.AWSClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.