@Test public void testCreateDhcpRelayProfile() throws IOException, InterruptedException { final DhcpRelayProfile mockResponse = new DhcpRelayProfile(); mockResponse.setId("id"); mockResponse.setResourceType(ServiceProfileResourceType.DHCP_RELAY_PROFILE); setupMocks(objectMapper.writeValueAsString(mockResponse), HttpStatus.SC_CREATED); DhcpServiceApi client = new DhcpServiceApi(restClient); final CountDownLatch latch = new CountDownLatch(1); client.createDhcpRelayProfile(new DhcpRelayProfileCreateSpec(), new com.google.common.util.concurrent.FutureCallback<DhcpRelayProfile>() { @Override public void onSuccess(DhcpRelayProfile result) { assertEquals(result, mockResponse); latch.countDown(); } @Override public void onFailure(Throwable t) { fail(t.toString()); latch.countDown(); } }); assertThat(latch.await(COUNTDOWNLATCH_AWAIT_TIMEOUT, TimeUnit.SECONDS), is(true)); }
public void createDhcpRelayProfile(DhcpRelayProfileCreateSpec request, FutureCallback<DhcpRelayProfile> responseCallback) throws IOException { postAsync(SERVICE_PROFILES_BASE_PATH, serializeObjectAsJson(request), HttpStatus.SC_CREATED, new TypeReference<DhcpRelayProfile>() {}, responseCallback); }
DhcpServiceApi extends NsxClientApi { public void createDhcpRelayProfile(DhcpRelayProfileCreateSpec request, FutureCallback<DhcpRelayProfile> responseCallback) throws IOException { postAsync(SERVICE_PROFILES_BASE_PATH, serializeObjectAsJson(request), HttpStatus.SC_CREATED, new TypeReference<DhcpRelayProfile>() {}, responseCallback); } }
DhcpServiceApi extends NsxClientApi { public void createDhcpRelayProfile(DhcpRelayProfileCreateSpec request, FutureCallback<DhcpRelayProfile> responseCallback) throws IOException { postAsync(SERVICE_PROFILES_BASE_PATH, serializeObjectAsJson(request), HttpStatus.SC_CREATED, new TypeReference<DhcpRelayProfile>() {}, responseCallback); } DhcpServiceApi(RestClient restClient); }
DhcpServiceApi extends NsxClientApi { public void createDhcpRelayProfile(DhcpRelayProfileCreateSpec request, FutureCallback<DhcpRelayProfile> responseCallback) throws IOException { postAsync(SERVICE_PROFILES_BASE_PATH, serializeObjectAsJson(request), HttpStatus.SC_CREATED, new TypeReference<DhcpRelayProfile>() {}, responseCallback); } DhcpServiceApi(RestClient restClient); void createDhcpRelayProfile(DhcpRelayProfileCreateSpec request,
                                     FutureCallback<DhcpRelayProfile> responseCallback); void getDhcpRelayProfile(String id,
                                  FutureCallback<DhcpRelayProfile> responseCallback); void deleteDhcpRelayProfile(String id,
                                     FutureCallback<Void> responseCallback); void createDhcpRelayService(DhcpRelayServiceCreateSpec request,
                                     FutureCallback<DhcpRelayService> responseCallback); void getDhcpRelayService(String id,
                                  FutureCallback<DhcpRelayService> responseCallback); void deleteDhcpRelayService(String id,
                                     FutureCallback<Void> responseCallback); }
DhcpServiceApi extends NsxClientApi { public void createDhcpRelayProfile(DhcpRelayProfileCreateSpec request, FutureCallback<DhcpRelayProfile> responseCallback) throws IOException { postAsync(SERVICE_PROFILES_BASE_PATH, serializeObjectAsJson(request), HttpStatus.SC_CREATED, new TypeReference<DhcpRelayProfile>() {}, responseCallback); } DhcpServiceApi(RestClient restClient); void createDhcpRelayProfile(DhcpRelayProfileCreateSpec request,
                                     FutureCallback<DhcpRelayProfile> responseCallback); void getDhcpRelayProfile(String id,
                                  FutureCallback<DhcpRelayProfile> responseCallback); void deleteDhcpRelayProfile(String id,
                                     FutureCallback<Void> responseCallback); void createDhcpRelayService(DhcpRelayServiceCreateSpec request,
                                     FutureCallback<DhcpRelayService> responseCallback); void getDhcpRelayService(String id,
                                  FutureCallback<DhcpRelayService> responseCallback); void deleteDhcpRelayService(String id,
                                     FutureCallback<Void> responseCallback); static final String SERVICE_PROFILES_BASE_PATH; static final String SERVICES_BASE_PATH; }