java/src/test/java/com/konfigthis/newscatcherapi/client/api/SourcesApiTest.java
<reponame>konfig-dev/newscatcher-sdks/*
 * NewsCatcher News API V2
 * NewsCatcher is a data-as-a-service startup that has one main goal: to build the largest database of structured news articles published online. In other words, we're like Google for the news part of the web, which you can access as a source of data.  Some useful links: - [How NewsCatcher Works](https://docs.newscatcherapi.com/knowledge-base/how-newscatcher-works) - [GitHub for the Python SDK](https://github.com/NewscatcherAPI/newscatcherapi-sdk-python) 
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: anpch@example.com
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */

package com.konfigthis.newscatcherapi.client.api;

import com.konfigthis.newscatcherapi.client.ApiClient;
import com.konfigthis.newscatcherapi.client.ApiException;
import com.konfigthis.newscatcherapi.client.Configuration;
import com.konfigthis.newscatcherapi.client.auth.ApiKeyAuth;
import com.konfigthis.newscatcherapi.client.model.Model200ResponseSources;
import com.konfigthis.newscatcherapi.client.model.SourcesQuery;
import com.konfigthis.newscatcherapi.client.model.Topic;
import com.konfigthis.newscatcherapi.client.model.SourcesQuery.LangEnum;

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 SourcesApi
 */
public class SourcesApiTest {

    private static SourcesApi api;

    @BeforeClass
    public static void beforeClass() {
        ApiClient apiClient = Configuration.getDefaultApiClient();
        ApiKeyAuth apiKey = (ApiKeyAuth) apiClient.getAuthentication("api_key");
        apiKey.setApiKey(System.getenv("NEWSCATCHER_API_KEY"));
        api = new SourcesApi(apiClient);
    }

    /**
     * Get top news sources supported by NewsCatcher.
     *
     * Returns a list of the top 100 supported news websites. Overall, we support
     * over 60,000 websites. Using this endpoint, you may find the top 100 for your
     * specific language, country, topic combination.
     *
     * @throws ApiException if the Api call fails
     */
    @Disabled
    @Test
    public void getTest() throws ApiException {
        String lang = null;
        String countries = null;
        Topic topic = null;
        Model200ResponseSources response = api.get(lang, countries, topic);
        // TODO: test validations
    }

    /**
     * Get top news sources supported by NewsCatcher.
     *
     * Returns a list of the top 100 supported news websites. Overall, we support
     * over 60,000 websites. Using this endpoint, you may find the top 100 for your
     * specific language, country, topic combination.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void postTest() throws ApiException {
        SourcesQuery sourcesQuery = new SourcesQuery().lang(LangEnum.EN);
        Model200ResponseSources response = api.post(sourcesQuery);
        assertNotNull(response, "Response is null");
    }

}
