/customer-api-java

Java API wrapper for the test.io customer API

Primary LanguageJavaMIT LicenseMIT

test IO Java API

Usage

Very simple example:

TestIoClientFactory factory = new TestIoClientFactory.Builder()
    .baseUrl("https://api.test.io/customer/v2/")
    .token("abcdefg")
    .build();

BugsClient bugsClient = factory.bugsClient();

Response<BugsResponse> resp = bugsClient.fetchBugs().execute();

List<Bug> bugs = resp.body().getBugs();

Add logging of requests/responses:

TestIoClientFactory factory = new TestIoClientFactory.Builder()
    .baseUrl("https://api.test.io/customer/v2/")
    .token("abcdefg")
    .loggingLevel(Level.BODY)
    .build();

    ...

Advanced Configuration

Custom HTTP Client

OkHttpClient client = new OkHttpClient.Builder()
    .connectTimeout(Duration.ofSeconds(10))
    .readTimeout(Duration.ofSeconds(10))
    .retryOnConnectionFailure(true)
    .build();
TestIoClientFactory factory = new TestIoClientFactory.Builder()
    .baseUrl("https://api.test.io/customer/v2/")
    .token("abcdefg")
    .client(client)
    .build();

    ...