Skip to content

Commit

Permalink
Published API specification v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jaaufauvre committed Dec 1, 2022
1 parent 78894da commit c3a1955
Show file tree
Hide file tree
Showing 12 changed files with 5,983 additions and 815 deletions.
6,445 changes: 5,787 additions & 658 deletions finicity.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.mastercard.finicity.client.ApiException;
import com.mastercard.finicity.client.model.CustomerAccount;
import com.mastercard.finicity.client.model.ReportType;
import com.mastercard.finicity.client.model.StatementData;
import com.mastercard.finicity.client.model.StatementReportConstraints;
import com.mastercard.finicity.client.test.BaseTest;
Expand Down Expand Up @@ -44,9 +43,9 @@ void generateStatementReportTest() {
.statementReportData(new StatementData()
.index(1)
.accountId(Long.valueOf(existingAccountId)));
var reportData = api.generateStatementReport(CUSTOMER_ID, constraints, null);
assertEquals("inProgress", reportData.getStatus());
assertEquals(ReportType.STATEMENT, reportData.getType());
var reportAck = api.generateStatementReport(CUSTOMER_ID, constraints, null);
assertEquals("inProgress", reportAck.getStatus());
assertEquals("statement", reportAck.getType());
} catch (ApiException e) {
fail(e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.mastercard.finicity.client.api;

import com.mastercard.finicity.client.ApiException;
import com.mastercard.finicity.client.model.ReportConstraints;
import com.mastercard.finicity.client.model.ReportType;
import com.mastercard.finicity.client.model.CashFlowReportConstraints;
import com.mastercard.finicity.client.test.BaseTest;
import com.mastercard.finicity.client.test.utils.AccountUtils;
import com.mastercard.finicity.client.test.utils.ConsumerUtils;
Expand Down Expand Up @@ -32,12 +31,12 @@ protected static void beforeAll() {
@Test
void generateCashFlowReportBusinessTest() {
try {
var constraints = new ReportConstraints()
var constraints = new CashFlowReportConstraints()
.showNsf(true)
.accountIds(customerAccountList);
var reportData = api.generateCashFlowBusinessReport(CUSTOMER_ID, constraints, null);
assertEquals("inProgress", reportData.getStatus());
assertEquals(ReportType.CFRB, reportData.getType());
var reportAck = api.generateCashFlowBusinessReport(CUSTOMER_ID, constraints, null);
assertEquals("inProgress", reportAck.getStatus());
assertEquals("cfrb", reportAck.getType());
} catch (ApiException e) {
// Status code: 429, Reason: Too Many Requests
logApiException(e);
Expand All @@ -47,12 +46,12 @@ void generateCashFlowReportBusinessTest() {
@Test
void generateCashFlowReportPersonalTest() {
try {
var constraints = new ReportConstraints()
var constraints = new CashFlowReportConstraints()
.showNsf(true)
.accountIds(customerAccountList);
var reportData = api.generateCashFlowPersonalReport(CUSTOMER_ID, constraints, null);
assertEquals("inProgress", reportData.getStatus());
assertEquals(ReportType.CFRP, reportData.getType());
var reportAck = api.generateCashFlowPersonalReport(CUSTOMER_ID, constraints, null);
assertEquals("inProgress", reportAck.getStatus());
assertEquals("cfrp", reportAck.getType());
} catch (ApiException e) {
// Status code: 429, Reason: Too Many Requests
logApiException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import com.mastercard.finicity.client.test.utils.AccountUtils;
import org.junit.jupiter.api.Test;

import static com.mastercard.finicity.client.model.BorrowerType.JOINTBORROWER;
import static com.mastercard.finicity.client.model.BorrowerType.PRIMARY;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -151,8 +149,8 @@ void generateJointBorrowerConnectUrlTest() {
try {
var params = new ConnectJointBorrowerParameters()
.partnerId(PARTNER_ID)
.addBorrowersItem(ModelFactory.newBorrower(PRIMARY, CONSUMER_ID, CUSTOMER_ID))
.addBorrowersItem(ModelFactory.newBorrower(JOINTBORROWER, CONSUMER_ID, CUSTOMER_ID));
.addBorrowersItem(ModelFactory.newBorrower("primary", CONSUMER_ID, CUSTOMER_ID))
.addBorrowersItem(ModelFactory.newBorrower("jointBorrower", CONSUMER_ID, CUSTOMER_ID));
var connectUrl = api.generateJointBorrowerConnectUrl(params);
var link = connectUrl.getLink();
assertTrue(link.contains("partnerId=" + PARTNER_ID));
Expand All @@ -168,8 +166,8 @@ void sendJointBorrowerConnectEmailTest() {
try {
var params = new ConnectJointBorrowerEmailParameters()
.partnerId(PARTNER_ID)
.addBorrowersItem(ModelFactory.newBorrower(PRIMARY, CONSUMER_ID, CUSTOMER_ID))
.addBorrowersItem(ModelFactory.newBorrower(JOINTBORROWER, CONSUMER_ID, CUSTOMER_ID))
.addBorrowersItem(ModelFactory.newBorrower("primary", CONSUMER_ID, CUSTOMER_ID))
.addBorrowersItem(ModelFactory.newBorrower("jointBorrower", CONSUMER_ID, CUSTOMER_ID))
.email(new EmailOptions().to("[email protected]"));
var connectEmailUrl = api.sendJointBorrowerConnectEmail(params);
var link = connectEmailUrl.getLink();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ void addCustomerTest() {
var username = "customer_" + RandomStringUtils.randomAlphabetic(10);
var newCustomer = new NewCustomer()
.username(username);
api.addCustomer(newCustomer);
fail();
var customer = api.addCustomer(newCustomer);
assertNotNull(customer.getId());
assertNotNull(customer.getCreatedDate());
assertEquals(newCustomer.getUsername(), customer.getUsername());
createdCustomerIds.add(customer.getId());
} catch (ApiException e) {
// HTTP 401: Not available from the Test Drive
logApiException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ void getAccountACHDetailsTest() {
assertNotNull(achDetails.getRealAccountNumber());
assertNotNull(achDetails.getRoutingNumber());
} catch (ApiException e) {
fail(e);
// {"code":20000,"message":"Routing number not found"}
assertErrorCodeEquals(20000, e);
logApiException(e);
}
}

Expand Down Expand Up @@ -64,6 +66,7 @@ void getLoanPaymentDetailsTest() {
fail();
} catch (ApiException e) {
// {"code":14020,"message":"Bad request. (Account type not supported)"}
assertErrorCodeEquals(14020, e);
logApiException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mastercard.finicity.client.api;

import com.mastercard.finicity.client.ApiException;
import com.mastercard.finicity.client.model.ReportConstraints;
import com.mastercard.finicity.client.model.VOAReportConstraints;
import com.mastercard.finicity.client.test.BaseTest;
import com.mastercard.finicity.client.test.utils.ConsumerUtils;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -24,7 +24,7 @@ protected static void beforeAll() {

// Create a report and get the portfolio ID
var verifyAssetsApi = new VerifyAssetsApi(apiClient);
portfolioId = verifyAssetsApi.generateVOAReport(CUSTOMER_ID, new ReportConstraints(), null).getPortfolioId();
portfolioId = verifyAssetsApi.generateVOAReport(CUSTOMER_ID, new VOAReportConstraints(), null).getPortfolioId();
} catch (ApiException e) {
fail(e);
}
Expand Down
Loading

0 comments on commit c3a1955

Please sign in to comment.