@Test(dependsOnMethods = "testAssociateWithOptions") public void testAssociate() { associationId = routeTableApi.associateRouteTable(TEST_REGION, routeTable.id(), subnet.getSubnetId()); assertNotNull(associationId, "Failed to obtain association id for " + routeTable.id() + " and " + subnet.getSubnetId()); routeTable = routeTableApi.describeRouteTables(TEST_REGION, routeTable.id()).toList().get(0); assertEquals(routeTable.associationSet().size(), 1, "Could not find expected association in routeTable " + routeTable.id()); }
@Test(dependsOnMethods = "testCreate") public void testAssociateWithOptions() { subnet = subnetApi.createSubnetInRegion(TEST_REGION, vpc.id(), VPC_SUBNET); assertNotNull(subnet, "Failed to create subnet in " + vpc.id()); try { routeTableApi.associateRouteTable(TEST_REGION, routeTable.id(), subnet.getSubnetId(), dryRun()); Assert.fail("Expected 'DryRunOperation' exception was not thrown"); } catch (AWSResponseException e) { assertDryRun(e); } }
public void associateRouteTable() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/associate_route_table.xml"); final String associationId = routeTableApi().associateRouteTable(DEFAULT_REGION, "rtb-8c95c0eb", "subnet-6986410e"); assertEquals(associationId, "rtbassoc-fb7fed9d", "Failed to associate route"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=AssociateRouteTable&RouteTableId=rtb-8c95c0eb&SubnetId=subnet-6986410e"); }
public void associateRouteTableNotFound() throws Exception { enqueueRegions(DEFAULT_REGION); enqueue(DEFAULT_REGION, new MockResponse().setResponseCode(404)); final String associationId = routeTableApi().associateRouteTable(DEFAULT_REGION, "rtb-8c95c0eb", "subnet-6986410e"); assertNull(associationId, "Returned id for non-existent route table: " + associationId); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=AssociateRouteTable&RouteTableId=rtb-8c95c0eb&SubnetId=subnet-6986410e"); }
public void associateRouteTableWithOptions() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(PRECONDITION_FAILED, DEFAULT_REGION, "/dry_run.xml"); try { routeTableApi().associateRouteTable(DEFAULT_REGION, "rtb-8c95c0eb", "subnet-6986410e", dryRun()); } catch (AWSResponseException e) { assertDryRun(e); } assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=AssociateRouteTable&RouteTableId=rtb-8c95c0eb&SubnetId=subnet-6986410e&DryRun=true"); }