diff --git a/.github/workflows/maven-test.yaml b/.github/workflows/maven-test.yaml index 909d0be..6e499e5 100644 --- a/.github/workflows/maven-test.yaml +++ b/.github/workflows/maven-test.yaml @@ -9,10 +9,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up JDK 1.8 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 17 - uses: actions/cache@v1 with: path: ~/.m2/repository diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b42b8e5..c6ae822 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 17 - uses: actions/cache@v1 with: path: ~/.m2/repository diff --git a/src/bambora-payment-starter/pom.xml b/src/bambora-payment-starter/pom.xml index c9a493e..45aaba5 100644 --- a/src/bambora-payment-starter/pom.xml +++ b/src/bambora-payment-starter/pom.xml @@ -5,11 +5,11 @@ ca.bc.gov.open bambora-payment-starter - 0.2.2 + 1.0.0 - 1.8 - 2.2.4.RELEASE + 17 + 3.1.3 2.17.1 @@ -69,7 +69,7 @@ ca.bc.gov.open spring-starters-bom - 0.2.2 + 1.0.0 pom import diff --git a/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardService.java b/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardService.java index 75f03e9..b360848 100644 --- a/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardService.java +++ b/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardService.java @@ -1,9 +1,11 @@ package ca.bc.gov.open.bambora.payment.starter.managment; +import java.net.URI; + import ca.bc.gov.open.bambora.payment.starter.managment.models.RecurringPaymentDetails; -import com.sun.jndi.toolkit.url.Uri; public interface BamboraCardService { - Uri setupRecurringPayment(RecurringPaymentDetails recurringPaymentDetails); + + URI setupRecurringPayment(RecurringPaymentDetails recurringPaymentDetails); } diff --git a/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImpl.java b/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImpl.java index 5d98d5b..4fee262 100644 --- a/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImpl.java +++ b/src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImpl.java @@ -1,18 +1,20 @@ package ca.bc.gov.open.bambora.payment.starter.managment; -import ca.bc.gov.open.bambora.payment.starter.BamboraConstants; -import ca.bc.gov.open.bambora.payment.starter.BamboraException; -import ca.bc.gov.open.bambora.payment.starter.BamboraProperties; -import ca.bc.gov.open.bambora.payment.starter.managment.models.RecurringPaymentDetails; -import com.sun.jndi.toolkit.url.Uri; -import org.apache.commons.codec.digest.DigestUtils; - import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; import java.text.MessageFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; +import org.apache.commons.codec.digest.DigestUtils; + +import ca.bc.gov.open.bambora.payment.starter.BamboraConstants; +import ca.bc.gov.open.bambora.payment.starter.BamboraException; +import ca.bc.gov.open.bambora.payment.starter.BamboraProperties; +import ca.bc.gov.open.bambora.payment.starter.managment.models.RecurringPaymentDetails; + public class BamboraCardServiceImpl implements BamboraCardService { private final BamboraProperties bamboraProperties; @@ -22,16 +24,18 @@ public BamboraCardServiceImpl(BamboraProperties bamboraProperties) { } @Override - public Uri setupRecurringPayment(RecurringPaymentDetails recurringPaymentDetails) { + public URI setupRecurringPayment(RecurringPaymentDetails recurringPaymentDetails) { try { return buildRecurringPaymentUrl(recurringPaymentDetails); } catch (MalformedURLException e) { throw new BamboraException("Url construction failed", e.getCause()); - } + } catch (URISyntaxException e) { + throw new BamboraException("Url construction failed", e.getCause()); + } } - private Uri buildRecurringPaymentUrl(RecurringPaymentDetails recurringPaymentDetails) throws MalformedURLException { + private URI buildRecurringPaymentUrl(RecurringPaymentDetails recurringPaymentDetails) throws MalformedURLException, URISyntaxException { String operationType = (recurringPaymentDetails.getEndUserId() != null ? BamboraConstants.OperationTypes.M.toString() : BamboraConstants.OperationTypes.N.toString()); @@ -56,7 +60,7 @@ private Uri buildRecurringPaymentUrl(RecurringPaymentDetails recurringPaymentDet paramString.append(MessageFormat.format("&{0}={1}&{2}={3}", BamboraConstants.PARAM_TRANS_HASH_VALUE, getHash(paramString.toString()), BamboraConstants.PARAM_TRANS_HASH_EXPIRY, getExpiry())); - return new Uri(MessageFormat.format("{0}?{1}", bamboraProperties.getHostedProfileUrl(), paramString.toString())); + return new URI(MessageFormat.format("{0}?{1}", bamboraProperties.getHostedProfileUrl(), paramString.toString())); } diff --git a/src/bambora-payment-starter/src/test/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImplTest.java b/src/bambora-payment-starter/src/test/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImplTest.java index 07ddb79..5c58c82 100644 --- a/src/bambora-payment-starter/src/test/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImplTest.java +++ b/src/bambora-payment-starter/src/test/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImplTest.java @@ -1,10 +1,16 @@ package ca.bc.gov.open.bambora.payment.starter.managment; +import java.net.URI; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; + import ca.bc.gov.open.bambora.payment.starter.BamboraException; import ca.bc.gov.open.bambora.payment.starter.BamboraProperties; import ca.bc.gov.open.bambora.payment.starter.managment.models.RecurringPaymentDetails; -import com.sun.jndi.toolkit.url.Uri; -import org.junit.jupiter.api.*; @TestInstance(TestInstance.Lifecycle.PER_CLASS) @DisplayName("Test BamboraCardServiceImpl") @@ -42,7 +48,7 @@ public void init() { public void withClientIdCreateUpdateUrl() { sut = new BamboraCardServiceImpl(bamboraProperties); - Uri actual = sut.setupRecurringPayment(createPaymentDetail(END_USER_ID)); + URI actual = sut.setupRecurringPayment(createPaymentDetail(END_USER_ID)); Assertions.assertNotNull(actual); Assertions.assertTrue(actual.toString().contains(BAMBORA_CLIENT_URL)); @@ -54,7 +60,7 @@ public void withClientIdCreateUpdateUrl() { public void withoutClientIdCreateUpdateUrl() { sut = new BamboraCardServiceImpl(bamboraProperties); - Uri actual = sut.setupRecurringPayment(createPaymentDetail(null)); + URI actual = sut.setupRecurringPayment(createPaymentDetail(null)); Assertions.assertNotNull(actual); Assertions.assertTrue(actual.toString().contains(BAMBORA_NEW_URL)); diff --git a/src/pom.xml b/src/pom.xml index c0989ac..5e46746 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -5,14 +5,14 @@ ca.bc.gov.open spring-starters - 0.2.2 + 1.0.0 spring-starters pom https://github.com/bcgov/spring-boot-starters - 1.8 + 17 2.17.1 diff --git a/src/spring-bceid-starter/pom.xml b/src/spring-bceid-starter/pom.xml index 0567685..9da675c 100644 --- a/src/spring-bceid-starter/pom.xml +++ b/src/spring-bceid-starter/pom.xml @@ -6,16 +6,20 @@ ca.bc.gov.open spring-bceid-starter - 0.2.2 + 1.0.0 - 1.8 + 17 UTF-8 - 1.8 - 1.8 - 2.2.4.RELEASE + 17 + 17 + 3.1.3 1.3.1.Final 2.17.1 + 4.0.1 + + + jdt_apt @@ -95,7 +99,7 @@ ca.bc.gov.open spring-starters-bom - 0.2.2 + 1.0.0 pom import @@ -126,7 +130,7 @@ org.apache.cxf cxf-codegen-plugin - 3.3.7 + ${org.apache.cxf.version} generate-sources diff --git a/src/spring-clamav-starter/pom.xml b/src/spring-clamav-starter/pom.xml index 611d13d..2b88d3f 100644 --- a/src/spring-clamav-starter/pom.xml +++ b/src/spring-clamav-starter/pom.xml @@ -6,14 +6,14 @@ ca.bc.gov.open spring-clamav-starter - 0.2.2 + 1.0.0 - 1.8 - 1.8 - 1.8 - 2.2.4.RELEASE - 2.22.0 + 17 + 17 + 17 + 3.1.3 + 3.1.2 2.17.1 @@ -63,7 +63,7 @@ ca.bc.gov.open spring-starters-bom - 0.2.2 + 1.0.0 pom import @@ -87,7 +87,7 @@ org.jacoco jacoco-maven-plugin - 0.8.2 + 0.8.7 diff --git a/src/spring-clamav-starter/src/test/java/ca/bc/gov/open/clamav/starter/ClamAvServiceImplTest.java b/src/spring-clamav-starter/src/test/java/ca/bc/gov/open/clamav/starter/ClamAvServiceImplTest.java index 8200805..48eebb9 100644 --- a/src/spring-clamav-starter/src/test/java/ca/bc/gov/open/clamav/starter/ClamAvServiceImplTest.java +++ b/src/spring-clamav-starter/src/test/java/ca/bc/gov/open/clamav/starter/ClamAvServiceImplTest.java @@ -23,7 +23,7 @@ class ClamAvServiceImplTest { @BeforeEach void setUp() throws IOException { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); sut = new ClamAvServiceImpl(clamAvClient); } diff --git a/src/spring-sftp-starter/pom.xml b/src/spring-sftp-starter/pom.xml index 4daee26..38742f3 100644 --- a/src/spring-sftp-starter/pom.xml +++ b/src/spring-sftp-starter/pom.xml @@ -7,13 +7,13 @@ ca.bc.gov.open spring-sftp-starter - 0.2.2 + 1.0.0 UTF-8 - 1.8 - 1.8 - 2.2.4.RELEASE + 17 + 17 + 3.1.3 2.17.1 @@ -79,7 +79,7 @@ ca.bc.gov.open spring-starters-bom - 0.2.2 + 1.0.0 pom import diff --git a/src/spring-starters-bom/pom.xml b/src/spring-starters-bom/pom.xml index 7c9acdd..4f37465 100644 --- a/src/spring-starters-bom/pom.xml +++ b/src/spring-starters-bom/pom.xml @@ -7,13 +7,13 @@ ca.bc.gov.open spring-starters-bom - 0.2.2 + 1.0.0 - 3.3.7 + 4.0.1 2.11.2 2.3.1 - 1.4 + 2.13.0 2.10.6 1.3.1.Final 1.0.1