sdks/java/src/test/java/com/konfigthis/client/api/TransactionsAndReportingApiTest.java
<gh_stars>0/*
 * SnapTrade
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: anpch@example.com
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */


package com.konfigthis.client.api;

import com.konfigthis.client.ApiException;
import com.konfigthis.client.ApiClient;
import com.konfigthis.client.ApiException;
import com.konfigthis.client.Configuration;
import java.time.LocalDate;
import com.konfigthis.client.model.PerformanceCustom;
import com.konfigthis.client.model.UniversalActivity;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.BeforeAll;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * API tests for TransactionsAndReportingApi
 */
@Disabled
public class TransactionsAndReportingApiTest {

    private static TransactionsAndReportingApi api;

    
    @BeforeAll
    public static void beforeClass() {
        ApiClient apiClient = Configuration.getDefaultApiClient();
        api = new TransactionsAndReportingApi(apiClient);
    }

    /**
     * Get transaction history for a user
     *
     * Returns activities (transactions) for a user. Specifing start and end date is highly recommended for automatic calls for better performance
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getActivitiesTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        LocalDate startDate = null;
        LocalDate endDate = null;
        String accounts = null;
        String brokerageAuthorizations = null;
        String type = null;
        List<UniversalActivity> response = api.getActivities(userId, userSecret)
                .startDate(startDate)
                .endDate(endDate)
                .accounts(accounts)
                .brokerageAuthorizations(brokerageAuthorizations)
                .type(type)
                .execute();
        // TODO: test validations
    }

    /**
     * Get performance information for a specific timeframe
     *
     * Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Total Equity Timeframe and Rate of Returns are experimental and should not be trusted to be 100% accurate
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getReportingCustomRangeTest() throws ApiException {
        LocalDate startDate = null;
        LocalDate endDate = null;
        String userId = null;
        String userSecret = null;
        String accounts = null;
        Boolean detailed = null;
        String frequency = null;
        PerformanceCustom response = api.getReportingCustomRange(startDate, endDate, userId, userSecret)
                .accounts(accounts)
                .detailed(detailed)
                .frequency(frequency)
                .execute();
        // TODO: test validations
    }

}
