Exemplo n.º 1
0
  @Test
  public void testApiClient() {
    // the default api client is used
    assertEquals(Configuration.getDefaultApiClient(), api.getApiClient());
    assertNotNull(api.getApiClient());
    assertEquals("http://petstore.swagger.io/v2", api.getApiClient().getBasePath());
    assertFalse(api.getApiClient().isDebugging());

    ApiClient oldClient = api.getApiClient();

    ApiClient newClient = new ApiClient();
    newClient.setBasePath("http://example.com");
    newClient.setDebugging(true);

    // set api client via constructor
    api = new PetApi(newClient);
    assertNotNull(api.getApiClient());
    assertEquals("http://example.com", api.getApiClient().getBasePath());
    assertTrue(api.getApiClient().isDebugging());

    // set api client via setter method
    api.setApiClient(oldClient);
    assertNotNull(api.getApiClient());
    assertEquals("http://petstore.swagger.io/v2", api.getApiClient().getBasePath());
    assertFalse(api.getApiClient().isDebugging());
  }
Exemplo n.º 2
0
 public PartnerApi() {
   this(Configuration.getDefaultApiClient());
 }
Exemplo n.º 3
0
 public StationApi() {
   this(Configuration.getDefaultApiClient());
 }