java/src/test/java/com/konfigthis/dojah/client/api/GhKycApiTest.java
/*
 * DOJAH APIs
 * Use Dojah to verify, onboard and manage user identity across Africa!
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */

package com.konfigthis.dojah.client.api;

import com.konfigthis.dojah.client.ApiClient;
import com.konfigthis.dojah.client.ApiException;
import com.konfigthis.dojah.client.Configuration;
import com.konfigthis.dojah.client.auth.ApiKeyAuth;
import com.konfigthis.dojah.client.model.GetDriversLicenseResponse;
import com.konfigthis.dojah.client.model.GetPassportResponse;
import com.konfigthis.dojah.client.model.GetSsnitResponse;

import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.BeforeClass;
import org.junit.jupiter.api.Disabled;
import org.junit.Test;

/**
 * API tests for GhKycApi
 */
public class GhKycApiTest {

    private static GhKycApi api;

    @BeforeClass
    public static void beforeClass() {
        // TODO FOLLOW THE README
        ApiClient apiClient = Configuration.getDefaultApiClient();
        apiClient.setApikeyAuth(System.getenv("DOJAH_API_KEY"));
        apiClient.setAppIdAuth(System.getenv("DOJAH_APP_ID"));
        apiClient.setBasePath("https://sandbox.dojah.io");
        api = new GhKycApi(apiClient);
    }

    /**
     * Driver&#39;s License
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getDriversLicenseTest() throws ApiException {
        String id = "V0000";
        String fullName = "John Doe";
        String dateOfBirth = "1988-09-01";
        GetDriversLicenseResponse response = api.getDriversLicense().id(id).fullName(fullName)
                .dateOfBirth(dateOfBirth).execute();
        assertNotNull(response, "Response is null");
    }

    /**
     * Passport
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPassportTest() throws ApiException {
        String id = "V0000";
        String firstName = "John";
        String lastName = "Doe";
        String middleName = "";
        String dateOfBirth = "1988-09-01";
        GetPassportResponse response = api.getPassport().id(id).firstName(firstName).lastName(lastName)
                .middleName(middleName).dateOfBirth(dateOfBirth).execute();
        assertNotNull(response, "Response is null");
    }

    /**
     * SSNIT
     *
     * @throws ApiException if the Api call fails
     */
    @Disabled
    @Test
    public void getSsnitTest() throws ApiException {
        String id = null;
        String fullName = null;
        String dateOfBirth = null;
        GetSsnitResponse response = api.getSsnit().id(id).fullName(fullName).dateOfBirth(dateOfBirth).execute();
        // TODO: test validations
    }

}
