public void describeRouteTablesWithInvalidStateValue() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/describe_route_tables_invalid.xml"); final ImmutableList<RouteTable> routeTables = routeTableApi().describeRouteTables(DEFAULT_REGION).toList(); assertNotNull(routeTables, "Failed to create route table description object"); assertEquals(routeTables.size(), 1, "Failed to return expected entry from test data, returned: " + routeTables); assertEquals(routeTables.get(0).routeSet().get(0).state(), Route.RouteState.UNRECOGNIZED); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DescribeRouteTables"); }
public void createRouteTable() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/create_route_table.xml"); RouteTable result = routeTableApi().createRouteTable(DEFAULT_REGION, "vpc-1a2b3c4d"); assertNotNull(result, "Failed to create RouteTable object"); assertEquals(result.id(), "rtb-8bda6cef", "Gateway id does not match mock data: " + result.id()); assertEquals(result.routeSet().size(), 2, "Should have 2 routes"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=CreateRouteTable&VpcId=vpc-1a2b3c4d"); }
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 deleteRouteTable() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/delete_route_table.xml"); final boolean deleted = routeTableApi().deleteRouteTable(DEFAULT_REGION, "rtb-8bda6cef"); assertTrue(deleted, "Failed to match 'true' data in test response"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DeleteRouteTable&RouteTableId=rtb-8bda6cef"); }
public void disassociateRouteTable() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/disassociate_route_table.xml"); final boolean result = routeTableApi().disassociateRouteTable(DEFAULT_REGION, "rtbassoc-fb7fed9d"); assertTrue(result, "Failed to disassociate route"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DisassociateRouteTable&AssociationId=rtbassoc-fb7fed9d"); }
public void deleteRoute() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/delete_route.xml"); final boolean deleted = routeTableApi().deleteRoute(DEFAULT_REGION, "rtb-a77f2ac0", destinationCidrBlock("172.18.19.0/24")); assertTrue(deleted, "Failed to match 'true' in test data response"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DeleteRoute&RouteTableId=rtb-a77f2ac0&DestinationCidrBlock=172.18.19.0/24"); }
public void describeRouteTablesNotFound() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/describe_route_tables.xml"); final ImmutableList<RouteTable> routeTables = routeTableApi().describeRouteTables(DEFAULT_REGION).toList(); assertNotNull(routeTables, "Failed to create route table description object"); assertEquals(routeTables.size(), 3, "Failed to return all entries from test data, returned: " + routeTables); for (RouteTable table : routeTables) { if (ImmutableList.of("rtb-80a3fae4", "rtb-d4605bb0").contains(table.id())) { assertRoutesForNormalVpc(table, table.id()); } else if (table.id().equals("rtb-e6c98381")) { assertRoutesForTestVpc(table, table.id()); } } assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DescribeRouteTables"); }
public void createRoute() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/create_route.xml"); final boolean created = routeTableApi().createRoute(DEFAULT_REGION, "rtb-a77f2ac0", gatewayId("igw-97e68af3").destinationCidrBlock("172.18.19.0/24")); assertTrue(created, "Failed to match 'true' in test data response"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=CreateRoute&RouteTableId=rtb-a77f2ac0&GatewayId=igw-97e68af3&DestinationCidrBlock=172.18.19.0/24"); }
public void createRouteTableWithOptions() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(PRECONDITION_FAILED, DEFAULT_REGION, "/dry_run.xml"); try { routeTableApi().createRouteTable(DEFAULT_REGION, "vpc-1a2b3c4d", dryRun()); Assert.fail("Expected 'DryRunOperation' exception was not thrown"); } catch (AWSResponseException e) { assertDryRun(e); } assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=CreateRouteTable&VpcId=vpc-1a2b3c4d&DryRun=true"); }
public void deleteRouteTableWithOptions() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(PRECONDITION_FAILED, DEFAULT_REGION, "/dry_run.xml"); try { routeTableApi().deleteRouteTable(DEFAULT_REGION, "rtb-8bda6cef", dryRun()); Assert.fail("Expected 'DryRunOperation' exception was not thrown"); } catch (AWSResponseException e) { assertDryRun(e); } assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DeleteRouteTable&RouteTableId=rtb-8bda6cef&DryRun=true"); }
public void createRouteNotFound() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/create_route.xml"); final boolean created = routeTableApi().createRoute(DEFAULT_REGION, "rtb-a77f2ac0", gatewayId("igw-97e68af3").destinationCidrBlock("172.18.19.0/24")); assertTrue(created, "Failed to match 'true' in test data response"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=CreateRoute&RouteTableId=rtb-a77f2ac0&GatewayId=igw-97e68af3&DestinationCidrBlock=172.18.19.0/24"); }
public void replaceRouteNotFound() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(DEFAULT_REGION, "/replace_route.xml"); final boolean created = routeTableApi().replaceRoute(DEFAULT_REGION, "rtb-a77f2ac0", gatewayId("vgw-1d00376e").destinationCidrBlock("172.18.19.0/24")); assertTrue(created, "Failed to match 'true' in test data response"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=ReplaceRoute&RouteTableId=rtb-a77f2ac0&GatewayId=vgw-1d00376e&DestinationCidrBlock=172.18.19.0/24"); }
public void disassociateRouteTablewithOptions() throws Exception { enqueueRegions(DEFAULT_REGION); enqueueXml(PRECONDITION_FAILED, DEFAULT_REGION, "/dry_run.xml"); try { routeTableApi().disassociateRouteTable(DEFAULT_REGION, "rtbassoc-fb7fed9d", dryRun()); } catch (AWSResponseException e) { assertDryRun(e); } assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DisassociateRouteTable&AssociationId=rtbassoc-fb7fed9d&DryRun=true"); }
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"); }