diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..fe4c44c
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,18 @@
+name: build
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: '21'
+ cache: maven
+ - run: ./mvnw -B clean verify
diff --git a/README.md b/README.md
index 83130e7..67b85e9 100644
--- a/README.md
+++ b/README.md
@@ -12,14 +12,14 @@ to expose the information from the core system of the bank in safe manner to all
## Technology
BankWS is using the following technologies:
-- Java [version: 11] (the language used to write the application)
+- Java [version: 21] (the language used to write the application)
- Maven [version:3.6] (the tool for managing dependencies and building the project)
-- Lombok [version:1.18.12] (the java library for removing boiler plate code from pojos)
-- Spring-Boot [version:2.3.0.RELEASE] (the framework for creating spring application that just run)
-- Spring-Data [version:2.3.0.RELEASE] (the framework for interacting with database)
-- H2 Database [version:1.4.2] (the database we use for storing the information in development enviroment)
-- Liquibase [version:3.8.9] (the tool for keeping the version control for relational databases)
-- JAX-WS [version:2.3.0] (the library for exposing soap web service endpoints)
+- Lombok [version:1.18.38] (the java library for removing boiler plate code from pojos)
+- Spring-Boot [version:3.3.13] (the framework for creating spring application that just run)
+- Spring-Data [version:3.3.13] (the framework for interacting with database)
+- H2 Database [version:2.2.224] (the database we use for storing the information in development enviroment)
+- Liquibase [version:4.27.0] (the tool for keeping the version control for relational databases)
+- Jakarta XML Web Services / JAX-WS RI [version:4.0.3] (the library for exposing soap web service endpoints)
## Implementation Details
diff --git a/mvnw b/mvnw
old mode 100644
new mode 100755
diff --git a/pom.xml b/pom.xml
index ce3a85a..a7d48fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.3.0.RELEASE
+ 3.3.13
com.github.rshtishi
@@ -16,7 +16,10 @@
Bank Web Service
- 11
+ 21
+ 4.0.3
+
+ 10.1.55
@@ -51,13 +54,19 @@
org.projectlombok
lombok
- 1.18.12
provided
org.liquibase
liquibase-core
+
+
+
+ javax.xml.bind
+ jaxb-api
+
+
@@ -68,9 +77,8 @@
com.sun.xml.ws
- jaxws-ri
- 2.3.0
- pom
+ jaxws-rt
+ ${jaxws.version}
diff --git a/src/main/java/com/github/rshtishi/bankws/config/SoapProperties.java b/src/main/java/com/github/rshtishi/bankws/config/SoapProperties.java
index be28e60..2a3fcac 100644
--- a/src/main/java/com/github/rshtishi/bankws/config/SoapProperties.java
+++ b/src/main/java/com/github/rshtishi/bankws/config/SoapProperties.java
@@ -11,7 +11,7 @@ public class SoapProperties {
private Endpoint endpoint = new Endpoint();
@Data
- public class Endpoint {
+ public static class Endpoint {
private String host;
private int port;
private String name;
diff --git a/src/main/java/com/github/rshtishi/bankws/config/SoapPublisher.java b/src/main/java/com/github/rshtishi/bankws/config/SoapPublisher.java
index d1ef3e5..6b6a4e9 100644
--- a/src/main/java/com/github/rshtishi/bankws/config/SoapPublisher.java
+++ b/src/main/java/com/github/rshtishi/bankws/config/SoapPublisher.java
@@ -1,6 +1,6 @@
package com.github.rshtishi.bankws.config;
-import javax.xml.ws.Endpoint;
+import jakarta.xml.ws.Endpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
diff --git a/src/main/java/com/github/rshtishi/bankws/entity/ActionTypeConverter.java b/src/main/java/com/github/rshtishi/bankws/entity/ActionTypeConverter.java
new file mode 100644
index 0000000..cacc64d
--- /dev/null
+++ b/src/main/java/com/github/rshtishi/bankws/entity/ActionTypeConverter.java
@@ -0,0 +1,29 @@
+package com.github.rshtishi.bankws.entity;
+
+import com.github.rshtishi.bankws.enums.ActionType;
+
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+
+@Converter(autoApply = true)
+public class ActionTypeConverter implements AttributeConverter {
+
+ @Override
+ public String convertToDatabaseColumn(ActionType actionType) {
+ return actionType == null ? null : actionType.getAction();
+ }
+
+ @Override
+ public ActionType convertToEntityAttribute(String action) {
+ if (action == null) {
+ return null;
+ }
+ for (ActionType actionType : ActionType.values()) {
+ if (actionType.getAction().equalsIgnoreCase(action)) {
+ return actionType;
+ }
+ }
+ throw new IllegalArgumentException("Unknown action type: " + action);
+ }
+
+}
diff --git a/src/main/java/com/github/rshtishi/bankws/entity/Transaction.java b/src/main/java/com/github/rshtishi/bankws/entity/Transaction.java
index 3989b94..de09997 100644
--- a/src/main/java/com/github/rshtishi/bankws/entity/Transaction.java
+++ b/src/main/java/com/github/rshtishi/bankws/entity/Transaction.java
@@ -2,12 +2,12 @@
import java.time.LocalDateTime;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
import com.github.rshtishi.bankws.enums.ActionType;
diff --git a/src/main/java/com/github/rshtishi/bankws/service/BankAccountService.java b/src/main/java/com/github/rshtishi/bankws/service/BankAccountService.java
index ed95fca..92450a8 100644
--- a/src/main/java/com/github/rshtishi/bankws/service/BankAccountService.java
+++ b/src/main/java/com/github/rshtishi/bankws/service/BankAccountService.java
@@ -2,9 +2,9 @@
import java.util.List;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
+import jakarta.jws.WebMethod;
+import jakarta.jws.WebParam;
+import jakarta.jws.WebService;
import com.github.rshtishi.bankws.entity.Transaction;
diff --git a/src/main/java/com/github/rshtishi/bankws/service/BankAccountServiceImpl.java b/src/main/java/com/github/rshtishi/bankws/service/BankAccountServiceImpl.java
index 144f34f..ae49489 100644
--- a/src/main/java/com/github/rshtishi/bankws/service/BankAccountServiceImpl.java
+++ b/src/main/java/com/github/rshtishi/bankws/service/BankAccountServiceImpl.java
@@ -2,9 +2,9 @@
import java.util.List;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
+import jakarta.jws.WebMethod;
+import jakarta.jws.WebParam;
+import jakarta.jws.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index eb6b9a0..b326527 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -9,7 +9,6 @@ spring.datasource.url=jdbc:h2:mem:bankdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
-spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
#SOAP
soap.endpoint.host=localhost
diff --git a/src/test/java/com/github/rshtishi/bankws/config/SoapPublisherTest.java b/src/test/java/com/github/rshtishi/bankws/config/SoapPublisherTest.java
new file mode 100644
index 0000000..ce01d73
--- /dev/null
+++ b/src/test/java/com/github/rshtishi/bankws/config/SoapPublisherTest.java
@@ -0,0 +1,33 @@
+package com.github.rshtishi.bankws.config;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.time.Duration;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class SoapPublisherTest {
+
+ @Autowired
+ private SoapProperties soapProperties;
+
+ @Test
+ void testWsdlIsPublished() throws Exception {
+ String url = "http://" + soapProperties.getEndpoint().getHost() + ":" + soapProperties.getEndpoint().getPort()
+ + "/" + soapProperties.getEndpoint().getName() + "?wsdl";
+ HttpResponse response = HttpClient.newHttpClient().send(
+ HttpRequest.newBuilder(URI.create(url)).timeout(Duration.ofSeconds(10)).GET().build(),
+ HttpResponse.BodyHandlers.ofString());
+
+ assertTrue(response.statusCode() == 200);
+ assertTrue(response.body().contains("getTrasactionsForClient"));
+ }
+
+}