Skip to content

Commit 92a4fb1

Browse files
committed
Fix build
1 parent f48b714 commit 92a4fb1

5 files changed

Lines changed: 18 additions & 16 deletions

File tree

.github/workflows/maven-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
java-version: [ 11 ]
10+
java-version: [ 17 ]
1111

1212
permissions:
1313
contents: read
@@ -22,7 +22,7 @@ jobs:
2222
java-version: ${{ matrix.java-version }}
2323

2424
- name: Cache Maven packages
25-
uses: actions/cache@v1
25+
uses: actions/cache@v4
2626
with:
2727
path: ~/.m2
2828
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@
6161
<plugin>
6262
<groupId>org.apache.maven.plugins</groupId>
6363
<artifactId>maven-surefire-plugin</artifactId>
64-
<version>3.0.0-M5</version>
64+
<version>3.5.3</version>
6565
<configuration>
6666
<runOrder>alphabetical</runOrder>
6767
<useSystemClassLoader>false</useSystemClassLoader>
6868
<redirectTestOutputToFile>true</redirectTestOutputToFile>
6969
<reportFormat>plain</reportFormat>
70-
<systemProperties>
70+
<systemPropertyVariables>
7171
<property>
7272
<name>java.io.tmpdir</name>
7373
<value>target</value>
@@ -80,7 +80,7 @@
8080
<name>user.region</name>
8181
<value>en</value>
8282
</property>
83-
</systemProperties>
83+
</systemPropertyVariables>
8484
</configuration>
8585
</plugin>
8686
<plugin>

src/main/java/com/twikey/modal/DocumentResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public static Document fromJson(JSONObject json, String state) {
145145
resp.debtorEmail = ctct.optString("EmailAdr");
146146
resp.customerNumber = ctct.optString("Othr");
147147

148-
resp.iban = mndt.getString("DbtrAcct");
148+
resp.iban = mndt.optString("DbtrAcct");
149149

150150
JSONObject agent = mndt.getJSONObject("DbtrAgt").getJSONObject("FinInstnId");
151151
resp.bic = agent.getString("BICFI");

src/test/java/com/twikey/DocumentGatewayTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class DocumentGatewayTest {
1717
private final String apiKey = System.getenv("TWIKEY_API_KEY"); // found in https://www.twikey.com/r/admin#/c/settings/api
1818

1919
private final String _ct = System.getenv("CT"); // found @ https://www.twikey.com/r/admin#/c/template
20+
private final String mndtNumber = System.getenv("MNDTNUMBER");
2021

2122
private Long ct;
2223

@@ -84,9 +85,9 @@ public void testSignMandate() throws Exception, TwikeyClient.UserException {
8485
}
8586

8687
@Test
87-
public void testAction() throws IOException, TwikeyClient.UserException, InterruptedException {
88+
public void testAction() throws IOException, TwikeyClient.UserException {
8889
Assume.assumeTrue("APIKey is set", apiKey != null);
89-
MandateActionRequest action = new MandateActionRequest(MandateActionRequest.MandateActionType.REMINDER, "CORERECURRENTNL18166")
90+
MandateActionRequest action = new MandateActionRequest(MandateActionRequest.MandateActionType.REMINDER, mndtNumber)
9091
.setReminder(1);
9192
api.document().action(action);
9293
}
@@ -116,28 +117,28 @@ public void testCancel() throws Exception, TwikeyClient.UserException {
116117
@Test
117118
public void testFetch() throws Exception, TwikeyClient.UserException {
118119
Assume.assumeTrue("APIKey is set", apiKey != null);
119-
MandateDetailRequest fetch = new MandateDetailRequest("CORERECURRENTNL18166")
120+
MandateDetailRequest fetch = new MandateDetailRequest(mndtNumber)
120121
.setForce(true);
121122
DocumentResponse.Document response = api.document().fetch(fetch);
122123
assertNotNull("Document Reference", response.getMandateNumber());
123124
}
124125

125126
@Test
126-
public void testUpdateMandate() throws IOException, TwikeyClient.UserException, InterruptedException {
127+
public void testUpdateMandate() throws IOException, TwikeyClient.UserException {
127128
Assume.assumeTrue("APIKey is set", apiKey != null);
128-
UpdateMandateRequest update = new UpdateMandateRequest("CORERECURRENTNL18166", customer, account);
129+
UpdateMandateRequest update = new UpdateMandateRequest(mndtNumber, customer, account);
129130
api.document().update(update);
130131
}
131132

132133
@Test
133-
public void testCustomerAccess() throws IOException, TwikeyClient.UserException, InterruptedException {
134+
public void testCustomerAccess() throws IOException, TwikeyClient.UserException {
134135
Assume.assumeTrue("APIKey is set", apiKey != null);
135-
DocumentResponse.CustomerAccessResponse response = api.document().customerAccess("CORERECURRENTNL18166");
136+
DocumentResponse.CustomerAccessResponse response = api.document().customerAccess(mndtNumber);
136137
assertNotNull("Document Customer Url", response.getUrl());
137138
}
138139

139140
@Test
140-
public void testRetrievePdf() throws IOException, TwikeyClient.UserException, InterruptedException {
141+
public void testRetrievePdf() throws IOException, TwikeyClient.UserException {
141142
Assume.assumeTrue("APIKey is set", apiKey != null);
142143
DocumentResponse.PdfResponse retrievedPdf = api.document().retrievePdf("CORERECURRENTNL18247");
143144
retrievedPdf.save("target/pdf.pdf");

src/test/java/com/twikey/RefundGatewayTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
public class RefundGatewayTest {
1515

1616
private final String apiKey = System.getenv("TWIKEY_API_KEY"); // found in https://www.twikey.com/r/admin#/c/settings/api
17+
private final String iban = System.getenv("REFUND_IBAN"); // found in https://www.twikey.com/r/admin#/c/settings/api
1718

1819
private final String ct = System.getenv("CT");
1920

@@ -37,8 +38,8 @@ public void createCustomer(){
3738
.setLang("nl")
3839
.setMobile("32498665995");
3940

40-
account = new DocumentRequests.Account("NL46ABNA8910219718", "ABNANL2A");
41-
41+
Assume.assumeTrue("IBAN is set", iban != null);
42+
account = new DocumentRequests.Account(iban, "ABNANL2A");
4243
api = new TwikeyClient(apiKey)
4344
.withTestEndpoint()
4445
.withUserAgent("twikey-api-java/junit");

0 commit comments

Comments
 (0)