LogicalRouterApi extends NsxClientApi { public void deleteLogicalRouter(String id, FutureCallback<Void> responseCallback) throws IOException { deleteAsync(LOGICAL_ROUTERS_BASE_PATH + "/" + id, HttpStatus.SC_OK, responseCallback); } LogicalRouterApi(RestClient restClient); void createLogicalRouter(LogicalRouterCreateSpec spec,
                                  FutureCallback<LogicalRouter> responseCallback); void getLogicalRouter(String id,
                               FutureCallback<LogicalRouter> responseCallback); void deleteLogicalRouter(String id,
                                  FutureCallback<Void> responseCallback); void checkLogicalRouterExistence(String id,
                                          FutureCallback<Boolean> responseCallback); void createLogicalRouterDownLinkPort(LogicalRouterDownLinkPortCreateSpec spec,
                                              FutureCallback<LogicalRouterDownLinkPort> responseCallback); void createLogicalRouterLinkPortTier0(LogicalRouterLinkPortOnTier0CreateSpec spec,
                                               FutureCallback<LogicalRouterLinkPortOnTier0> responseCallback); void createLogicalRouterLinkPortTier1(LogicalRouterLinkPortOnTier1CreateSpec spec,
                                               FutureCallback<LogicalRouterLinkPortOnTier1> responseCallback); void listLogicalRouterPorts(String id,
                                     FutureCallback<LogicalRouterPortListResult> responseCallback); void deleteLogicalRouterPort(String id,
                                      FutureCallback<Void> responseCallback); void checkLogicalRouterPortExistence(String id,
                                              FutureCallback<Boolean> responseCallback); void createNatRule(String id,
                            NatRuleCreateSpec spec,
                            FutureCallback<NatRule> responseCallback); void getNatRule(String id,
                         String ruleId,
                         FutureCallback<NatRule> responseCallback); void deleteNatRule(String id,
                            String ruleId,
                            FutureCallback<Void> responseCallback); void configureRoutingAdvertisement(String id,
                                            RoutingAdvertisementUpdateSpec spec,
                                            FutureCallback<RoutingAdvertisement> responseCallback); void getRoutingAdvertisement(String id,
                                      FutureCallback<RoutingAdvertisement> responseCallback); static final String LOGICAL_ROUTERS_BASE_PATH; static final String LOGICAL_ROUTER_PORTS_BASE_PATH; }
@Test public void testDeleteLogicalRouterAsync() throws IOException, InterruptedException { setupMocks(null, HttpStatus.SC_OK); LogicalRouterApi client = new LogicalRouterApi(restClient); final CountDownLatch latch = new CountDownLatch(1); client.deleteLogicalRouter("id", new com.google.common.util.concurrent.FutureCallback<Void>() { @Override public void onSuccess(Void result) { latch.countDown(); } @Override public void onFailure(Throwable t) { fail(t.toString()); latch.countDown(); } }); assertThat(latch.await(COUNTDOWNLATCH_AWAIT_TIMEOUT, TimeUnit.SECONDS), is(true)); }