Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Empty file modified mvnw
100644 → 100755
Empty file.
20 changes: 14 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.0.RELEASE</version>
<version>3.3.13</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.github.rshtishi</groupId>
Expand All @@ -16,7 +16,10 @@
<description>Bank Web Service</description>

<properties>
<java.version>11</java.version>
<java.version>21</java.version>
<jaxws.version>4.0.3</jaxws.version>
<!-- ahead of the version managed by Spring Boot 3.3.13 (10.1.42) to pick up Tomcat security fixes -->
<tomcat.version>10.1.55</tomcat.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -51,13 +54,19 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version><!--$NO-MVN-MAN-VER$ -->
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<exclusions>
<!-- Liquibase pulls the legacy javax JAXB API; the jakarta API from jaxws-rt is used instead -->
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
</exclusions>
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
</dependency>

<dependency>
Expand All @@ -68,9 +77,8 @@

<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>2.3.0</version>
<type>pom</type>
<artifactId>jaxws-rt</artifactId>
<version>${jaxws.version}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<ActionType, String> {

@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);
}
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved

}
12 changes: 6 additions & 6 deletions src/main/java/com/github/rshtishi/bankws/entity/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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<String> 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"));
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
}
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved

}
Loading