Skip to content

Commit

Permalink
LI-50459 - Add support to git hubaction
Browse files Browse the repository at this point in the history
  • Loading branch information
grmeyer-hw-dev committed Jul 4, 2024
1 parent e8dfe73 commit 71f1970
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 2 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Java SDK CI

on:
workflow_dispatch:
push:
branches:
- master
- support/SDK-V3
- feature/**
- bugfix/**
- dependabot/**

jobs:
build:
# Compile the project using the predefined JDK versions in the strategy section
runs-on: ubuntu-latest
name: Build - JDK ${{ matrix.java-version }}

strategy:
fail-fast: false
matrix:
java-version: [ 8 ]

steps:
- uses: actions/checkout@v3

- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}

- name: Build and Test JDK ${{ matrix.java-version }}
# --batch-mode Run in non-interactive (batch) mode (disables output color)
# --update-snapshots Forces a check for missing releases and updated snapshots on remote repositories
run: mvn --batch-mode --update-snapshots compile

test:
# Perform the unit and integration tests using the predefined JDK versions in the strategy section
needs: [build]
runs-on: ubuntu-latest
name: Test - JDK ${{ matrix.java-version }}

strategy:
fail-fast: false
matrix:
java-version: [ 8, 9, 10, 11, 12, 13, 14, 15, 16 ,17, 18 ]

steps:
- uses: actions/checkout@v3

- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
architecture: x64
java-version: ${{ matrix.java-version }}

- name: Run the Maven test phase JDK ${{ matrix.java-version }}
# --batch-mode Run in non-interactive (batch) mode (disables output color)
# --update-snapshots Forces a check for missing releases and updated snapshots on remote repositories
run: mvn --batch-mode --update-snapshots test

code-coverage:
needs: [ test ]
runs-on: ubuntu-latest

name: Report code coverage - JDK ${{ matrix.java-version }}

strategy:
fail-fast: false
matrix:
java-version: [ 8 ]
steps:
- uses: actions/checkout@v3

- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}

- name: "Report: Coverage via coveralls.io"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
mvn clean \
cobertura:cobertura \
coveralls:report \
--no-transfer-progress \
-D repoToken=$COVERALLS_REPO_TOKEN
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog
=========
1.9.6
-------------------
- Added support to CREDIT, PREPAID, FIS, UNKNOWN bank card types.
1.9.5
-------------------
- Added support to unclaimed status transition.
1.9.4
-------------------
- Added attribute 'isDefaultTransferMethod' to identify default accounts.
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/com/hyperwallet/clientsdk/HyperwalletIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,11 @@ public void testListBankCard() throws Exception {
assertThat(returnValue.getData().get(0).getProcessingTime(), is(nullValue()));
assertThat(returnValue.getData().get(0).getDateOfExpiry(), is(equalTo(dateFormat.parse("2018-11-01T00:00:00 UTC"))));
assertThat(returnValue.getData().get(0).getCvv(), is(nullValue()));

assertThat(returnValue.getData().get(2).getCardType(), is(equalTo(HyperwalletBankCard.CardType.CREDIT)));
assertThat(returnValue.getData().get(3).getCardType(), is(equalTo(HyperwalletBankCard.CardType.PREPAID)));
assertThat(returnValue.getData().get(4).getCardType(), is(equalTo(HyperwalletBankCard.CardType.FIS)));
assertThat(returnValue.getData().get(5).getCardType(), is(equalTo(HyperwalletBankCard.CardType.UNKNOWN)));
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/integration/getBankCard-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-cards/trm-7e915660-8c97-47bf-8a4f-0c1bc890d46f"
}
]
}
}
82 changes: 81 additions & 1 deletion src/test/resources/integration/listBankCards-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,86 @@
"href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-cards/trm-7742f31d-452c-4bf7-8645-c003fa1511d5"
}
]
},
{
"token": "trm-7742f31d-452c-4bf7-8645-c003fa151144",
"type": "BANK_CARD",
"status": "ACTIVATED",
"createdOn": "2017-11-09T23:18:34",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"cardType": "CREDIT",
"cardNumber": "************0113",
"cardBrand": "VISA",
"dateOfExpiry": "2018-12",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-cards/trm-7742f31d-452c-4bf7-8645-c003fa151144"
}
]
},
{
"token": "trm-7742f31d-452c-4bf7-8645-c003fa151155",
"type": "BANK_CARD",
"status": "ACTIVATED",
"createdOn": "2017-11-09T23:18:34",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"cardType": "PREPAID",
"cardNumber": "************0114",
"cardBrand": "VISA",
"dateOfExpiry": "2018-12",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-cards/trm-7742f31d-452c-4bf7-8645-c003fa151155"
}
]
},
{
"token": "trm-7742f31d-452c-4bf7-8645-c003fa151156",
"type": "BANK_CARD",
"status": "ACTIVATED",
"createdOn": "2017-11-09T23:18:34",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"cardType": "FIS",
"cardNumber": "************0115",
"cardBrand": "VISA",
"dateOfExpiry": "2018-12",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-cards/trm-7742f31d-452c-4bf7-8645-c003fa151156"
}
]
},
{
"token": "trm-7742f31d-452c-4bf7-8645-c003fa151177",
"type": "BANK_CARD",
"status": "INVALID",
"createdOn": "2017-11-09T23:18:34",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"cardType": "UNKNOWN",
"cardNumber": "************0144",
"cardBrand": "VISA",
"dateOfExpiry": "2018-12",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-cards/trm-7742f31d-452c-4bf7-8645-c003fa151177"
}
]
}
],
"links": [
Expand All @@ -52,4 +132,4 @@
"href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-cards?offset=0&limit=10"
}
]
}
}

0 comments on commit 71f1970

Please sign in to comment.