Skip to content

Commit

Permalink
Update ReportsApiTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadavpadma authored Jan 16, 2025
1 parent dc38409 commit f5ea801
Showing 1 changed file with 53 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.mastercard.openbanking.client.api;

import com.google.gson.JsonObject;
import com.mastercard.openbanking.client.ApiException;
import com.mastercard.openbanking.client.model.*;
import com.mastercard.openbanking.client.test.BaseTest;
Expand Down Expand Up @@ -212,8 +211,8 @@ void getStatementReportByConsumerOrCustomerTest() throws Exception {
// Create a report the first time
var constraints = new StatementReportConstraints()
.statementReportData(new StatementData()
.statementIndex(1)
.accountId(Long.valueOf(existingAccountId)));
.statementIndex(1)
.accountId(Long.valueOf(existingAccountId)));
var reportAck = bankStatementsApi.generateStatementReport(CUSTOMER_ID, constraints, null);
reportId = reportAck.getId();
}
Expand Down Expand Up @@ -269,8 +268,8 @@ void getTransactionsReportByConsumerOrCustomerTest() throws Exception {
if (reportId == null) {
// Create a report the first time
var toDate = LocalDateTime.now().toEpochSecond(UTC);
var fromDate = LocalDateTime.now().minusYears(10).toEpochSecond(UTC);
var reportAck = transactionsApi.generateTransactionsReport(CUSTOMER_ID,fromDate, toDate, new TransactionsReportConstraints(), null, true);
var fromDate = LocalDateTime.now().minusYears(2).toEpochSecond(UTC);
var reportAck = transactionsApi.generateTransactionsReport(CUSTOMER_ID, new TransactionsReportConstraints(), null, fromDate,toDate,true);
reportId = reportAck.getId();
}
fetchReport(reportId, consumerId);
Expand Down Expand Up @@ -351,67 +350,67 @@ private static void fetchReport(String reportId, String consumerId) throws Excep

private static String getReportStatus(Report reportInstance) throws IllegalArgumentException {
System.out.println("reportInstance : "+reportInstance);
Object report = reportInstance.getActualInstance();
System.out.println("Report type while getReportStatus: " + report.getClass()+" END");
if (report instanceof CashFlowReport) {
return ((CashFlowReport) report).getStatus();
}
Object report = reportInstance.getActualInstance();
System.out.println("Report type while getReportStatus: " + report.getClass()+" END");
if (report instanceof CashFlowReport) {
return ((CashFlowReport) report).getStatus();
}

if (report instanceof PayStatementReport) {
return ((PayStatementReport) report).getStatus();
}
if (report instanceof PayStatementReport) {
return ((PayStatementReport) report).getStatus();
}

if (report instanceof PrequalificationReport) {
return ((PrequalificationReport) report).getStatus();
}
if (report instanceof PrequalificationReport) {
return ((PrequalificationReport) report).getStatus();
}

if (report instanceof StatementReport) {
return ((StatementReport) report).getStatus();
}
if (report instanceof StatementReport) {
return ((StatementReport) report).getStatus();
}

if (report instanceof TransactionsReport) {
return ((TransactionsReport) report).getStatus();
}
if (report instanceof TransactionsReport) {
return ((TransactionsReport) report).getStatus();
}

if (report instanceof VOAReport) {
return ((VOAReport) report).getStatus();
}
if (report instanceof VOAReport) {
return ((VOAReport) report).getStatus();
}

if (report instanceof VOAWithIncomeReport) {
return ((VOAWithIncomeReport) report).getStatus();
}
if (report instanceof VOAWithIncomeReport) {
return ((VOAWithIncomeReport) report).getStatus();
}

if (report instanceof VOEPayrollReport) {
return ((VOEPayrollReport) report).getStatus();
}
if (report instanceof VOEPayrollReport) {
return ((VOEPayrollReport) report).getStatus();
}

if (report instanceof VOETransactionsReport) {
return ((VOETransactionsReport) report).getStatus();
}
if (report instanceof VOETransactionsReport) {
return ((VOETransactionsReport) report).getStatus();
}

if (report instanceof VOIEPayrollReport) {
return ((VOIEPayrollReport) report).getStatus();
}
if (report instanceof VOIEPayrollReport) {
return ((VOIEPayrollReport) report).getStatus();
}

if (report instanceof VOIEPaystubReport) {
return ((VOIEPaystubReport) report).getStatus();
}
if (report instanceof VOIEPaystubReport) {
return ((VOIEPaystubReport) report).getStatus();
}

if (report instanceof VOIEPaystubWithTXVerifyReport) {
return ((VOIEPaystubWithTXVerifyReport) report).getStatus();
}
if (report instanceof VOIEPaystubWithTXVerifyReport) {
return ((VOIEPaystubWithTXVerifyReport) report).getStatus();
}

if (report instanceof VOIReport) {
return ((VOIReport) report).getStatus();
}
if (report instanceof VOIReport) {
return ((VOIReport) report).getStatus();
}

if (report instanceof AFBalanceAnalyticsReport) {
return ((AFBalanceAnalyticsReport) report).getStatus();
}
if (report instanceof AFBalanceAnalyticsReport) {
return ((AFBalanceAnalyticsReport) report).getStatus();
}

if (report instanceof AFCashFlowAnalyticsReport) {
return ((AFCashFlowAnalyticsReport) report).getStatus();
}
if (report instanceof AFCashFlowAnalyticsReport) {
return ((AFCashFlowAnalyticsReport) report).getStatus();
}



Expand All @@ -424,6 +423,6 @@ private static String getReportStatus(Report reportInstance) throws IllegalArgum



throw new IllegalArgumentException("Invalid report type"+report.getClass()+" END");
}
throw new IllegalArgumentException("Invalid report type"+report.getClass()+" END");
}
}

0 comments on commit f5ea801

Please sign in to comment.