Search in sources :

Example 1 with ChangeInfo

use of com.amazonaws.services.route53.model.ChangeInfo in project Synapse-Stack-Builder by Sage-Bionetworks.

the class Route53SetupTest method testSetupResourcesAllFound.

@Ignore
@Test
public void testSetupResourcesAllFound() throws Exception {
    String stack = "stack";
    String hostedZoneDomainName = stack + ".sagebase.org.";
    ListHostedZonesResult res = new ListHostedZonesResult();
    List<HostedZone> expectedHostedZones = new ArrayList<HostedZone>();
    HostedZone hz = new HostedZone().withName(hostedZoneDomainName);
    expectedHostedZones.add(hz);
    hz = new HostedZone().withName("anotherzone.sagebase.org.");
    expectedHostedZones.add(hz);
    res.setHostedZones(expectedHostedZones);
    Map<ListResourceRecordSetsRequest, ListResourceRecordSetsResult> expectedResourceRecordSetsResults = TestHelper.createListExpectedListResourceRecordSetsRequestAllFound(stack);
    when(mockClient.listHostedZones()).thenReturn(res);
    // Args for getResourceRecordSetForRecordName().listResourceRecordSets()
    for (ListResourceRecordSetsRequest req : expectedResourceRecordSetsResults.keySet()) {
        when(mockClient.listResourceRecordSets(req)).thenReturn(expectedResourceRecordSetsResults.get(req));
    }
    ChangeInfo expectedChangeInfo = new ChangeInfo().withId("changeInfoId").withStatus(ChangeStatus.INSYNC);
    ChangeResourceRecordSetsResult expectedChangeResourceRecordSetsResult = new ChangeResourceRecordSetsResult().withChangeInfo(expectedChangeInfo);
    when(mockClient.changeResourceRecordSets(any(ChangeResourceRecordSetsRequest.class))).thenReturn(expectedChangeResourceRecordSetsResult);
    Route53Setup r53Setup = new Route53Setup(factory, config, resources);
}
Also used : HostedZone(com.amazonaws.services.route53.model.HostedZone) ListResourceRecordSetsRequest(com.amazonaws.services.route53.model.ListResourceRecordSetsRequest) ChangeInfo(com.amazonaws.services.route53.model.ChangeInfo) ArrayList(java.util.ArrayList) ListHostedZonesResult(com.amazonaws.services.route53.model.ListHostedZonesResult) ChangeResourceRecordSetsResult(com.amazonaws.services.route53.model.ChangeResourceRecordSetsResult) ChangeResourceRecordSetsRequest(com.amazonaws.services.route53.model.ChangeResourceRecordSetsRequest) ListResourceRecordSetsResult(com.amazonaws.services.route53.model.ListResourceRecordSetsResult) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

ChangeInfo (com.amazonaws.services.route53.model.ChangeInfo)1 ChangeResourceRecordSetsRequest (com.amazonaws.services.route53.model.ChangeResourceRecordSetsRequest)1 ChangeResourceRecordSetsResult (com.amazonaws.services.route53.model.ChangeResourceRecordSetsResult)1 HostedZone (com.amazonaws.services.route53.model.HostedZone)1 ListHostedZonesResult (com.amazonaws.services.route53.model.ListHostedZonesResult)1 ListResourceRecordSetsRequest (com.amazonaws.services.route53.model.ListResourceRecordSetsRequest)1 ListResourceRecordSetsResult (com.amazonaws.services.route53.model.ListResourceRecordSetsResult)1 ArrayList (java.util.ArrayList)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1