From bf1889147d73c69b2e149347cb76d1c1410b7f57 Mon Sep 17 00:00:00 2001 From: Marcin Warzybok Date: Mon, 15 Jan 2024 11:03:49 +0100 Subject: [PATCH 1/2] SP-752 Code Examples: Java --- .../sdk/model/settlement/SettlementTest.java | 157 +++++++++--------- 1 file changed, 79 insertions(+), 78 deletions(-) diff --git a/src/test/java/com/bitpay/sdk/model/settlement/SettlementTest.java b/src/test/java/com/bitpay/sdk/model/settlement/SettlementTest.java index 381f5efc..380d0d56 100644 --- a/src/test/java/com/bitpay/sdk/model/settlement/SettlementTest.java +++ b/src/test/java/com/bitpay/sdk/model/settlement/SettlementTest.java @@ -4,6 +4,7 @@ package com.bitpay.sdk.model.settlement; +import java.time.ZonedDateTime; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Assertions; @@ -76,84 +77,84 @@ public void it_should_change_status() { // then Assertions.assertEquals(expected, testedClass.getStatus()); } -// -// @Test -// public void it_should_change_dateCreated() { -// // given -// Long expected = 12L; -// Settlement testedClass = this.getTestedClass(); -// -// // when -// testedClass.setDateCreated(expected); -// -// // then -// Assertions.assertEquals(expected, testedClass.getDateCreated()); -// } -// -// @Test -// public void it_should_change_dateExecuted() { -// // given -// Long expected = 12L; -// Settlement testedClass = this.getTestedClass(); -// -// // when -// testedClass.setDateExecuted(expected); -// -// // then -// Assertions.assertEquals(expected, testedClass.getDateExecuted()); -// } -// -// @Test -// public void it_should_change_dateCompleted() { -// // given -// Long expected = 12L; -// Settlement testedClass = this.getTestedClass(); -// -// // when -// testedClass.setDateCompleted(expected); -// -// // then -// Assertions.assertEquals(expected, testedClass.getDateCompleted()); -// } -// -// @Test -// public void it_should_change_openingDate() { -// // given -// Long expected = 12L; -// Settlement testedClass = this.getTestedClass(); -// -// // when -// testedClass.setOpeningDate(expected); -// -// // then -// Assertions.assertEquals(expected, testedClass.getOpeningDate()); -// } -// -// @Test -// public void it_should_change_closingDate() { -// // given -// Long expected = 12L; -// Settlement testedClass = this.getTestedClass(); -// -// // when -// testedClass.setClosingDate(expected); -// -// // then -// Assertions.assertEquals(expected, testedClass.getClosingDate()); -// } -// -// @Test -// public void it_should_change_openingBalance() { -// // given -// Float expected = 12.34F; -// Settlement testedClass = this.getTestedClass(); -// -// // when -// testedClass.setOpeningBalance(expected); -// -// // then -// Assertions.assertEquals(expected, testedClass.getOpeningBalance()); -// } + + @Test + public void it_should_change_dateCreated() { + // given + ZonedDateTime expected = ZonedDateTime.now(); + Settlement testedClass = this.getTestedClass(); + + // when + testedClass.setDateCreated(expected); + + // then + Assertions.assertEquals(expected, testedClass.getDateCreated()); + } + + @Test + public void it_should_change_dateExecuted() { + // given + ZonedDateTime expected = ZonedDateTime.now(); + Settlement testedClass = this.getTestedClass(); + + // when + testedClass.setDateExecuted(expected); + + // then + Assertions.assertEquals(expected, testedClass.getDateExecuted()); + } + + @Test + public void it_should_change_dateCompleted() { + // given + ZonedDateTime expected = ZonedDateTime.now(); + Settlement testedClass = this.getTestedClass(); + + // when + testedClass.setDateCompleted(expected); + + // then + Assertions.assertEquals(expected, testedClass.getDateCompleted()); + } + + @Test + public void it_should_change_openingDate() { + // given + ZonedDateTime expected = ZonedDateTime.now(); + Settlement testedClass = this.getTestedClass(); + + // when + testedClass.setOpeningDate(expected); + + // then + Assertions.assertEquals(expected, testedClass.getOpeningDate()); + } + + @Test + public void it_should_change_closingDate() { + // given + ZonedDateTime expected = ZonedDateTime.now(); + Settlement testedClass = this.getTestedClass(); + + // when + testedClass.setClosingDate(expected); + + // then + Assertions.assertEquals(expected, testedClass.getClosingDate()); + } + + @Test + public void it_should_change_openingBalance() { + // given + Float expected = 12.34F; + Settlement testedClass = this.getTestedClass(); + + // when + testedClass.setOpeningBalance(expected); + + // then + Assertions.assertEquals(expected, testedClass.getOpeningBalance()); + } @Test public void it_should_change_ledgerEntriesSum() { From f536d895ed1f11d9fdf7d2f84e042da18c285e7a Mon Sep 17 00:00:00 2001 From: Marcin Warzybok Date: Thu, 18 Jan 2024 12:47:56 +0100 Subject: [PATCH 2/2] SP-768 Java SDK - Support Java 21 --- .github/workflows/build.yml | 2 +- pom.xml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee030c12..8aaa3be7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - java-version: [8, 11, 17] + java-version: [8, 11, 17, 21] steps: - uses: actions/checkout@v3 diff --git a/pom.xml b/pom.xml index 0e84e8c2..b8938544 100644 --- a/pom.xml +++ b/pom.xml @@ -272,6 +272,12 @@ 4.11.0 test + + + net.bytebuddy + byte-buddy + 1.14.11 + commons-io commons-io