@Test(dependsOnMethods = "testDeleteRoute") public void testDeleteRouteTableWithOptions() { try { routeTableApi.deleteRouteTable(TEST_REGION, routeTable.id(), dryRun()); Assert.fail("Expected 'DryRunOperation' exception was not thrown"); } catch (AWSResponseException e) { assertDryRun(e); } }
@Test(dependsOnMethods = "testDeleteRouteTableWithOptions") public void testDeleteRouteTable() { final ImmutableList<RouteTable> before = routeTableApi.describeRouteTables(TEST_REGION, routeTable.id()).toList(); assertEquals(before.size(), 1, "Unexpected response to describe of " + routeTable.id() + ": " + before); assertEquals(before.get(0).id(), routeTable.id(), "Wrong table returned for " + routeTable.id() + ": " + before); final boolean deleted = routeTableApi.deleteRouteTable(TEST_REGION, routeTable.id()); assertTrue(deleted, "Failed to delete route table " + routeTable.id()); final ImmutableList<RouteTable> after = routeTableApi.describeRouteTables(TEST_REGION, routeTable.id()).toList(); assertEquals(after.size(), 0, "Unexpected response to describe after deleting " + routeTable.id() + ": " + after); }
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 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 deleteRouteTableNotFound() throws Exception { enqueueRegions(DEFAULT_REGION); enqueue(DEFAULT_REGION, new MockResponse().setResponseCode(404)); final boolean deleted = routeTableApi().deleteRouteTable(DEFAULT_REGION, "rtb-8bda6cef"); assertFalse(deleted, "Non-existent table reported as successfully deleted"); assertPosted(DEFAULT_REGION, "Action=DescribeRegions"); assertPosted(DEFAULT_REGION, "Action=DeleteRouteTable&RouteTableId=rtb-8bda6cef"); }