From 01a89dcbdb32214817aaba0889924f06c3e7e019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20van=20de=20Giessen?= Date: Fri, 14 Oct 2016 11:37:59 +0200 Subject: [PATCH 1/5] .gitignore .project and .settings --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index eb5a316..8baf289 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ target +.project +.settings From 9267f9a0904f22a8e14705493314d8e0dbd941c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20van=20de=20Giessen?= Date: Fri, 14 Oct 2016 12:07:17 +0200 Subject: [PATCH 2/5] unused imports --- src/main/java/nl/stil4m/mollie/Client.java | 5 ----- src/main/java/nl/stil4m/mollie/DynamicClient.java | 6 ------ 2 files changed, 11 deletions(-) diff --git a/src/main/java/nl/stil4m/mollie/Client.java b/src/main/java/nl/stil4m/mollie/Client.java index 08eea03..f87f6e5 100644 --- a/src/main/java/nl/stil4m/mollie/Client.java +++ b/src/main/java/nl/stil4m/mollie/Client.java @@ -1,11 +1,6 @@ package nl.stil4m.mollie; import nl.stil4m.mollie.concepts.*; -import nl.stil4m.mollie.domain.CreatePayment; -import nl.stil4m.mollie.domain.CreatedPayment; -import nl.stil4m.mollie.domain.Payment; - -import java.io.IOException; public class Client { diff --git a/src/main/java/nl/stil4m/mollie/DynamicClient.java b/src/main/java/nl/stil4m/mollie/DynamicClient.java index b39aff5..14ab917 100644 --- a/src/main/java/nl/stil4m/mollie/DynamicClient.java +++ b/src/main/java/nl/stil4m/mollie/DynamicClient.java @@ -1,12 +1,6 @@ package nl.stil4m.mollie; import nl.stil4m.mollie.concepts.*; -import nl.stil4m.mollie.domain.ApiKeyCheck; -import nl.stil4m.mollie.domain.CreatePayment; -import nl.stil4m.mollie.domain.CreatedPayment; -import nl.stil4m.mollie.domain.Payment; - -import java.io.IOException; public class DynamicClient { From 27d595a0ce95f4835be2a22e93d56d234ce99df4 Mon Sep 17 00:00:00 2001 From: Mats Stijlaart Date: Tue, 25 Oct 2016 10:09:02 +0200 Subject: [PATCH 3/5] Be less strict about datetime of created payments, due to mismatch test machine and mollie instance --- .../java/nl/stil4m/mollie/ClientIntegrationTest.java | 4 ++-- .../nl/stil4m/mollie/DynamicClientIntegrationTest.java | 10 +++++----- .../domain/subpayments/CreateIdealPaymentTest.java | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java b/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java index c5d1592..285752b 100644 --- a/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java +++ b/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java @@ -45,7 +45,7 @@ public void testCreatePayment() throws IOException, InterruptedException { Date beforeTest = new Date(); ResponseOrError payment = client.payments().create(new CreatePayment(Optional.empty(), 1.00, "Some description", "http://example.com", Optional.empty(), null)); - DynamicClientIntegrationTest.assertWithin(beforeTest, payment.getData().getCreatedDatetime(), new Date()); + DynamicClientIntegrationTest.assertWithin(beforeTest, payment.getData().getCreatedDatetime(), new Date(), 5000L); } @Test @@ -58,7 +58,7 @@ public void testCreateIdealPayment() throws IOException, URISyntaxException, Int ResponseOrError payment = client.payments().create(new CreateIdealPayment(1.00, "Some description", "http://example.com", Optional.empty(), null, new IdealPaymentOptions(issuer.getId()))); assertThat(payment.getSuccess(), is(true)); - DynamicClientIntegrationTest.assertWithin(beforeTest, payment.getData().getCreatedDatetime(), new Date()); + DynamicClientIntegrationTest.assertWithin(beforeTest, payment.getData().getCreatedDatetime(), new Date(), 5000L); } @Test diff --git a/src/test/java/nl/stil4m/mollie/DynamicClientIntegrationTest.java b/src/test/java/nl/stil4m/mollie/DynamicClientIntegrationTest.java index f449809..e7e2317 100644 --- a/src/test/java/nl/stil4m/mollie/DynamicClientIntegrationTest.java +++ b/src/test/java/nl/stil4m/mollie/DynamicClientIntegrationTest.java @@ -53,7 +53,7 @@ public void testCreatePayment() throws IOException { ResponseOrError payment = client.payments(VALID_API_KEY).create(new CreatePayment(Optional.empty(), 1.00, "Some description", "http://example.com", Optional.empty(), meta)); CreatedPayment createdPayment = payment.getData(); - assertWithin(beforeTest, createdPayment.getCreatedDatetime(), new Date()); + assertWithin(beforeTest, createdPayment.getCreatedDatetime(), new Date(), 5000L); assertThat(createdPayment.getMethod(), is(nullValue())); assertThat(createdPayment.getAmount(), is(1.00)); @@ -78,7 +78,7 @@ public void testCreatePaymentWithMethod() throws IOException { ResponseOrError payment = client.payments(VALID_API_KEY).create(new CreatePayment(Optional.of("ideal"), 1.00, "Some description", "http://example.com", Optional.empty(), meta)); CreatedPayment createdPayment = payment.getData(); - assertWithin(beforeTest, createdPayment.getCreatedDatetime(), new Date()); + assertWithin(beforeTest, createdPayment.getCreatedDatetime(), new Date(), 5000L); assertThat(createdPayment.getMethod(), is("ideal")); assertThat(createdPayment.getAmount(), is(1.00)); @@ -144,9 +144,9 @@ public void testCreateAndGetCreditCardPayment() throws IOException { } - public static void assertWithin(Date before, Date target, Date after) { - long beforeTime = before.getTime() - (before.getTime() % 1000) - 1000; //Subtract another 1000 just to be safe - long afterTime = after.getTime() - (after.getTime() % 1000) + 1000; + public static void assertWithin(Date before, Date target, Date after, Long additionalSpan) { + long beforeTime = before.getTime() - (before.getTime() % 1000) - additionalSpan; + long afterTime = after.getTime() - (after.getTime() % 1000) + additionalSpan; assertThat(beforeTime <= target.getTime(), is(true)); assertThat(target.getTime() <= afterTime, is(true)); } diff --git a/src/test/java/nl/stil4m/mollie/domain/subpayments/CreateIdealPaymentTest.java b/src/test/java/nl/stil4m/mollie/domain/subpayments/CreateIdealPaymentTest.java index 7e2b00a..c100ea0 100644 --- a/src/test/java/nl/stil4m/mollie/domain/subpayments/CreateIdealPaymentTest.java +++ b/src/test/java/nl/stil4m/mollie/domain/subpayments/CreateIdealPaymentTest.java @@ -23,6 +23,7 @@ public class CreateIdealPaymentTest { public void before() throws InterruptedException { Thread.sleep(TEST_TIMEOUT); } + @Test public void testSerialize() throws IOException { ObjectMapper objectMapper = new ObjectMapper(); From fd539fcfc09cfb67ec90b053bfc6503203e5b306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20van=20de=20Giessen?= Date: Wed, 26 Oct 2016 09:08:23 +0200 Subject: [PATCH 4/5] cleanup/standardized pom using spring-boot version properties name scheme and using maven.compiler. instead of build plugin element --- pom.xml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 2ee5121..9f5ad3e 100644 --- a/pom.xml +++ b/pom.xml @@ -9,9 +9,11 @@ Mollie API UTF-8 - 4.11 - 1.10.19 + 4.11 + 1.10.19 2.8.0 + 1.8 + 1.8 @@ -20,7 +22,7 @@ junit junit-dep - ${junit-version} + ${junit.version} test @@ -32,7 +34,7 @@ org.mockito mockito-core - ${org.mockito-mockito-all-version} + ${mockito.version} test @@ -84,15 +86,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.8 - 1.8 - - org.apache.maven.plugins maven-source-plugin From 48a3450c4af78ec73d6ca207214b14ad88479404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20van=20de=20Giessen?= Date: Wed, 26 Oct 2016 09:26:32 +0200 Subject: [PATCH 5/5] unused imports --- src/main/java/nl/stil4m/mollie/concepts/Methods.java | 1 - src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java | 1 - src/test/java/nl/stil4m/mollie/IssuesIntegrationTest.java | 1 - 3 files changed, 3 deletions(-) diff --git a/src/main/java/nl/stil4m/mollie/concepts/Methods.java b/src/main/java/nl/stil4m/mollie/concepts/Methods.java index 603d36c..cbe77ff 100644 --- a/src/main/java/nl/stil4m/mollie/concepts/Methods.java +++ b/src/main/java/nl/stil4m/mollie/concepts/Methods.java @@ -10,7 +10,6 @@ import java.io.IOException; import java.net.URISyntaxException; -import java.util.List; import java.util.Optional; import static nl.stil4m.mollie.Util.validatePaymentId; diff --git a/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java b/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java index 285752b..2b47b92 100644 --- a/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java +++ b/src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java @@ -1,6 +1,5 @@ package nl.stil4m.mollie; -import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Sets; import nl.stil4m.mollie.domain.CreatePayment; import nl.stil4m.mollie.domain.CreatedPayment; diff --git a/src/test/java/nl/stil4m/mollie/IssuesIntegrationTest.java b/src/test/java/nl/stil4m/mollie/IssuesIntegrationTest.java index 46ee9cb..41fec64 100644 --- a/src/test/java/nl/stil4m/mollie/IssuesIntegrationTest.java +++ b/src/test/java/nl/stil4m/mollie/IssuesIntegrationTest.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import nl.stil4m.mollie.domain.CreatePayment; -import nl.stil4m.mollie.domain.CreatedPayment; import nl.stil4m.mollie.domain.subpayments.ideal.CreateIdealPayment; import nl.stil4m.mollie.domain.subpayments.ideal.IdealPaymentOptions; import org.junit.Before;