@Test(dependsOnMethods = "testCreateRoute") public void testDeleteRoute() { final boolean deleted = routeTableApi.deleteRoute(TEST_REGION, routeTable.id(), destinationCidrBlock(TEST_DESTINATION_CIDR)); assertTrue(deleted, "Failed to delete " + TEST_DESTINATION_CIDR + " route from route table " + routeTable.id()); // clean up the test gateway final Boolean cleaned = gwApi.detachInternetGateway(TEST_REGION, gateway.id(), vpc.id()); assertTrue(cleaned, "Failed to delete gateway " + gateway.id()); final boolean gatewayDeleted = gwApi.deleteInternetGateway(TEST_REGION, gateway.id()); assertTrue(gatewayDeleted, "Failed to delete test gateway " + gateway.id()); }
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 deleteRouteNotFound() throws Exception { enqueueRegions(DEFAULT_REGION); enqueue(DEFAULT_REGION, new MockResponse().setResponseCode(404)); final boolean deleted = routeTableApi().deleteRoute(DEFAULT_REGION, "rtb-a77f2ac0", destinationCidrBlock("172.18.19.0/24")); assertFalse(deleted, "Reported successful delete of route in non-existent route table"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DeleteRoute&RouteTableId=rtb-a77f2ac0&DestinationCidrBlock=172.18.19.0/24"); }