Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSDK version update - 17.0.0 #280

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
# restore-keys: |
# ${{ runner.os }}-maven-
- uses: actions/setup-java@v2
name: Set up JDK 17
name: Set up JDK 21
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
# - name: Set up Apache Maven Central
# uses: actions/setup-java@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ The following are the initially required software pieces:

2. **Git**: it can be downloaded and installed from https://git-scm.com/downloads.

3. **Java 17 EA**: it can be downloaded and installed from https://jdk.java.net/17/.
3. **Java 21 EA**: it can be downloaded and installed from https://jdk.java.net/21/.

4. **Spring Boot Initializer**: This *Initializer* generates *spring* boot project with just what you need to start quickly! Start from here https://start.spring.io/.

Expand Down
18 changes: 9 additions & 9 deletions TESTCONTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,18 @@ As long as we have TestContainers and the appropriate JDBC driver on your classp
- For Spring Boot (Before version 2.3.0) you need to specify the driver manually
`spring.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver`

Original URL: `jdbc:mysql:5.7://somehostname:someport/databasename`
Original URL: `jdbc:mysql:8.0://somehostname:someport/databasename`

Insert `tc:` after `jdbc:` as follows. Note that the hostname, port and database name will be ignored; you can leave these as-is or set them to any value.

TestContainers URL with a specific version: `jdbc:tc:mysql:5.7:///databasename`
TestContainers URL with a specific version: `jdbc:tc:mysql:8.0:///databasename`

For multiple databases testing we can use different profiles:

# application-mysql.yaml
spring:
datasource:
url: jdbc:tc:mysql:5.7://localhost:3306/dbs
url: jdbc:tc:mysql:8.0://localhost:3306/dbs
username: root
password: root
driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
Expand All @@ -155,19 +155,19 @@ For multiple databases testing we can use different profiles:
##### Using a classpath init script
Testcontainers can run an init script after the database container is started, but before your code is given a connection to it. The script must be on the classpath, and is referenced as follows:

`jdbc:tc:mysql:5.7.22:///databasename?TC_INITSCRIPT=somepath/init_mysql.sql`
`jdbc:tc:mysql:8.0.22:///databasename?TC_INITSCRIPT=somepath/init_mysql.sql`

This is useful if you have a fixed script for setting up database schema, etc.

##### Using an init script from a file
If the init script path is prefixed file:, it will be loaded from a file (relative to the working directory, which will usually be the project root).

`jdbc:tc:mysql:5.7.22:///databasename?TC_INITSCRIPT=file:src/main/resources/init_mysql.sql`
`jdbc:tc:mysql:8.0.22:///databasename?TC_INITSCRIPT=file:src/main/resources/init_mysql.sql`

##### Using an init function
Instead of running a fixed script for DB setup, it may be useful to call a Java function that you define. This is intended to allow you to trigger database schema migration tools. To do this, add TC_INITFUNCTION to the URL as follows, passing a full path to the class name and method:

`jdbc:tc:mysql:5.7.22:///databasename?TC_INITFUNCTION=org.testcontainers.jdbc.JDBCDriverTest::sampleInitFunction`
`jdbc:tc:mysql:8.0:///databasename?TC_INITFUNCTION=org.testcontainers.jdbc.JDBCDriverTest::sampleInitFunction`

The init function must be a public static method which takes a java.sql.Connection as its only parameter, e.g.

Expand All @@ -180,7 +180,7 @@ The init function must be a public static method which takes a java.sql.Connecti
##### Running container in daemon mode
By default database container is being stopped as soon as last connection is closed. There are cases when you might need to start container and keep it running till you stop it explicitly or JVM is shutdown. To do this, add TC_DAEMON parameter to the URL as follows:

`jdbc:tc:mysql:5.7.22:///databasename?TC_DAEMON=true`
`jdbc:tc:mysql:8.0:///databasename?TC_DAEMON=true`

With this parameter database container will keep running even when there're no open connections.

Expand All @@ -202,14 +202,14 @@ More info: https://www.testcontainers.org/modules/databases/jdbc/
For MySQL databases, it is possible to override configuration settings using resources on the classpath.
Assuming `db/mysql_conf_override` is a directory on the classpath containing `.cnf` files, the following URL can be used:

`jdbc:tc:mysql:5.7:///databasename?TC_MY_CNF=db/mysql_conf_override`
`jdbc:tc:mysql:8.0:///databasename?TC_MY_CNF=db/mysql_conf_override`

##### Database container objects
In case you can't use the URL support, or need to fine-tune the container, you can instantiate it yourself.
Add a `@Rule` or `@ClassRule` to your test class, e.g.:

@ClassRule
public static MySQLContainer mysqlSQLContainer = new MySQLContainer("mysql:5.7");
public static MySQLContainer mysqlSQLContainer = new MySQLContainer("mysql:8.0");

static class Initializer
implements ApplicationContextInitializer<ConfigurableApplicationContext> {
Expand Down
6 changes: 3 additions & 3 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>com.backbase.buildingblocks</groupId>
<artifactId>backbase-openapi-spec-starter-parent</artifactId>
<version>16.0.1</version>
<version>17.0.0</version>
<relativePath/>
</parent>

<groupId>com.backbase.goldensample</groupId>
<artifactId>api</artifactId>
<packaging>pom</packaging>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>

<modules>
<module>product-api</module>
Expand All @@ -24,7 +24,7 @@

<properties>
<frontend-plugin.version>1.12.1</frontend-plugin.version>
<boat-maven-plugin.version>0.17.24</boat-maven-plugin.version>
<boat-maven-plugin.version>0.17.32</boat-maven-plugin.version>
</properties>

<build>
Expand Down
2 changes: 1 addition & 1 deletion api/product-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>api</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<name>Backbase :: product-api</name>
Expand Down
2 changes: 1 addition & 1 deletion api/review-service-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>api</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<name>Backbase :: review-service-api</name>
Expand Down
2 changes: 1 addition & 1 deletion api/store-client-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>api</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<name>Backbase :: store-client-api</name>
Expand Down
2 changes: 1 addition & 1 deletion api/store-integration-enricher-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>api</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<name>Backbase :: store-integration-enricher-api</name>
Expand Down
4 changes: 2 additions & 2 deletions charts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>backbase-golden-sample</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>charts</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<name>backbase-golden-sample-chart</name>
<description>Demo project for Backbase Backend Best Practices</description>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>backbase-golden-sample</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>database</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion database/product-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>database</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>product-db</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion database/review-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>database</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>review-db</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
- "61614:61614"

mysql:
image: mysql:5.7.18
image: mysql:8.0
# Set max_allowed_packet to 512M for provisioning
command: --max-allowed-packet=512M --performance-schema=FALSE --transaction-isolation=READ-COMMITTED --init-connect='SET collation_connection=utf8_bin' --init-connect='SET NAMES utf8;' --character-set-server=utf8 --collation-server=utf8_bin --lower-case-table-names=2 --max-connections=500
container_name: demo_mysql
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<parent>
<artifactId>service-sdk-starter-core</artifactId>
<groupId>com.backbase.buildingblocks</groupId>
<version>16.0.1</version>
<version>17.0.0</version>
<relativePath />
</parent>

<groupId>com.backbase.goldensample</groupId>
<artifactId>backbase-golden-sample</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<name>backbase-golden-example</name>
<description>Demo project for Backbase Backend Best Practices</description>
<packaging>pom</packaging>
Expand Down
8 changes: 4 additions & 4 deletions services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>backbase-golden-sample</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>services</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
Expand All @@ -20,8 +20,8 @@

<properties>
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
<testcontainers.version>1.19.1</testcontainers.version>
<boat-maven-plugin.version>0.17.24</boat-maven-plugin.version>
<testcontainers.version>1.19.7</testcontainers.version>
<boat-maven-plugin.version>0.17.32</boat-maven-plugin.version>
<jqno.equalsverifier.version>3.14.1</jqno.equalsverifier.version>
<docker.repo.project>experimental/golden-sample</docker.repo.project>
</properties>
Expand Down
4 changes: 2 additions & 2 deletions services/product/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>services</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>product</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Backbase :: product-service</name>

Expand Down
4 changes: 2 additions & 2 deletions services/product/src/test/resources/application-m10y.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ backbase:
tenants:
- id: org_shop
datasource:
url: jdbc:tc:mysql:5.7:///testdb1?TC_MY_CNF=db/mysql_conf_override
url: jdbc:tc:mysql:8.0:///testdb1?TC_MY_CNF=db/mysql_conf_override
username: test
password: test
- id: rebrand_shop
datasource:
url: jdbc:tc:mysql:5.7:///testdb2?TC_MY_CNF=db/mysql_conf_override
url: jdbc:tc:mysql:8.0:///testdb2?TC_MY_CNF=db/mysql_conf_override
username: test
password: test
datasource:
Expand Down
4 changes: 2 additions & 2 deletions services/product/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ spring:
# ## since Spring Boot can deduce it for most databases from the url.
driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
# Useful if we want to load the Database with a lot of data before the test kick in (disable liquibase first)
# url: jdbc:tc:mysql:5.7:///test?TC_INITSCRIPT=file:src/test/resources/product-10k-rows.sql
url: jdbc:tc:mysql:5.7:///test?TC_MY_CNF=db/mysql_conf_override
# url: jdbc:tc:mysql:8.0:///test?TC_INITSCRIPT=file:src/test/resources/product-10k-rows.sql
url: jdbc:tc:mysql:8.0:///test?TC_MY_CNF=db/mysql_conf_override
username: test
password: test

Expand Down
4 changes: 2 additions & 2 deletions services/review/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>services</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>review</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Backbase :: review-service</name>

Expand Down
4 changes: 2 additions & 2 deletions services/review/src/test/resources/application-m10y.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ backbase:
tenants:
- id: org_shop
datasource:
url: jdbc:tc:mysql:5.7:///testdb1?TC_MY_CNF=db/mysql_conf_override
url: jdbc:tc:mysql:8.0:///testdb1?TC_MY_CNF=db/mysql_conf_override
username: test
password: test
- id: rebrand_shop
datasource:
url: jdbc:tc:mysql:5.7:///testdb2?TC_MY_CNF=db/mysql_conf_override
url: jdbc:tc:mysql:8.0:///testdb2?TC_MY_CNF=db/mysql_conf_override
username: test
password: test
datasource:
Expand Down
2 changes: 1 addition & 1 deletion services/review/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring:
datasource:
## You often do not need to specify the driver-class-name,
## since Spring Boot can deduce it for most databases from the url.
url: jdbc:tc:mysql:5.7:///databasename?TC_MY_CNF=db/mysql_conf_override
url: jdbc:tc:mysql:8.0:///databasename?TC_MY_CNF=db/mysql_conf_override
username: test
password: test

Expand Down
4 changes: 2 additions & 2 deletions services/store/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.backbase.goldensample</groupId>
<artifactId>services</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>store</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Backbase :: store-service</name>

Expand Down
Loading