/*
 * Echo Server API
 * Echo Server API
 *
 * The version of the OpenAPI document: 0.1.0
 * Contact: team@openapitools.org
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;

import org.junit.Test;

/**
 * API tests for AuthApi
 */
public class AuthApiTest {

    private final AuthApi api = new AuthApi();

    /**
     * To test HTTP basic authentication
     *
     * <p>To test HTTP basic authentication
     */
    @Test
    public void testAuthHttpBasicTest() {
        // given
        api.getApiClient().setUsername("test_user");
        api.getApiClient().setPassword("test_password");

        // when
        String response = api.testAuthHttpBasic();

        assertThat(
                response,
                containsString("Authorization: Basic dGVzdF91c2VyOnRlc3RfcGFzc3dvcmQ="));
    }

    /**
     * To test HTTP bearer authentication
     *
     * <p>To test HTTP bearer authentication
     */
    @Test
    public void testAuthHttpBearerTest() {
        // given
        api.getApiClient().setBearerToken("test_token");

        // when
        String response = api.testAuthHttpBearer();

        assertThat(response, containsString("Authorization: Bearer test_token"));
    }
}