Repository: jhipster/generator-jhipster (ts)

Issue:
Include Testcontainers in the main generator
##### **Overview of the feature request**

I just released a new version of this module: https://github.com/intesys/generator-jhipster-testcontainers. It allows to run integration tests on sql databases with testcontainers. It's very simple (it basically adds a properties file in test resources) and it doesn't impact the existing code. A user can keep running integration tests on H2 or switching to testcontainers simply add the `testcontainers` profile when running tests.

What about including this in the main generator?

##### **Motivation for or Use Case**

We've been using testcontainers for a while and I think it is really helpful. Jhipster already uses this library to run test with other databases. Adding this also for sql database would be a plus for developers. 

##### **Related issues or PR**

https://github.com/jhipster/generator-jhipster/issues/10958 


-   [x] Checking this box is mandatory (this is just to show you read everything)

<!-- Love JHipster? Please consider supporting our collective:
👉  https://opencollective.com/generator-jhipster/donate -->


Pull request:
Testcontainers for SQL databases
Fixes #11544

Allows to run tests with by enabling testcontainers with the `testcontainers` profile:

```
./mvnw verify -Dspring.profiles.active=testcontainers
```
```
./gradlew integrationTest -Ptestcontainers
```
- [x] testcontainers for sql db
- [x] HibernateTimeZoneIT tests for Mysql and MariaDB
- [ ] r2dbc support
- [x] ci-cd templates

-   [ ] [All continuous integration tests](https://github.com/jhipster/generator-jhipster/actions) are green
-   [x] Tests are added where necessary
-   [ ] Documentation is added/updated where necessary
-   [X] Coding Rules & Commit Guidelines as per our [CONTRIBUTING.md document](https://github.com/jhipster/generator-jhipster/blob/master/CONTRIBUTING.md) are followed

<!--
Please also reference the issue number in a commit message to [automatically close the related Github issue](https://help.github.com/articles/closing-issues-via-commit-messages/)

Note: It is also possible to add `[skip ci]` or `[ci skip]` to your commit message to skip continuous integration tests
-->


Patch:
diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml
index c4a78a4d9d..ccb08a03da 100644
--- a/.github/workflows/angular.yml
+++ b/.github/workflows/angular.yml
@@ -61,57 +61,68 @@ jobs:
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 1
                     - app-type: ngx-psql-es-noi18n-mapsid
                       entity: sqlfull
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: ngx-mariadb-oauth2-infinispan
                       entity: sqlfull
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: ngx-mongodb-kafka-cucumber
                       entity: mongodb
                       profile: dev,webpack
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: ngx-h2mem-ws-nol2
                       entity: sql
                       profile: dev,webpack
                       war: 0 # TODO: need change to 1, when maven+war is fixed
                       protractor: 1
+                      testcontainers: 0
                     - app-type: ngx-gradle-fr
                       entity: sql
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: ngx-gradle-psql-es-noi18n-mapsid
                       entity: sqlfull
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 1
                     - app-type: ngx-gradle-mariadb-oauth2-infinispan
                       entity: sql
                       profile: dev,webpack
                       war: 0
                       protractor: 1
+                      testcontainers: 1
                     - app-type: ngx-gradle-mongodb-kafka-cucumber
                       entity: mongodb
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: ngx-gradle-yarn-h2disk-ws-nocache
                       entity: sql
                       profile: dev,webpack
                       war: 1
                       protractor: 1
+                      testcontainers: 0
         env:
             JHI_ENTITY: ${{ matrix.entity }}
             JHI_APP: ${{ matrix.app-type }}
             JHI_PROFILE: ${{ matrix.profile }}
             JHI_WAR: ${{ matrix.war }}
             JHI_PROTRACTOR: ${{ matrix.protractor }}
+            JHI_TESTCONTAINERS: ${{ matrix.testcontainers }}
         steps:
             #----------------------------------------------------------------------
             # Install all tools and check configuration
diff --git a/.github/workflows/react.yml b/.github/workflows/react.yml
index 48ca4bad87..3453b7fad8 100644
--- a/.github/workflows/react.yml
+++ b/.github/workflows/react.yml
@@ -60,52 +60,62 @@ jobs:
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: react-maven-psql-es-noi18n-mapsid
                       entity: sqlfull
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 1
                     - app-type: react-maven-h2mem-memcached
                       entity: sql
                       profile: dev,webpack
                       war: 0 # TODO: need change to 1, when maven+war is fixed
                       protractor: 1
+                      testcontainers: 0
                     - app-type: react-maven-cassandra-session-redis
                       entity: cassandra
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: react-maven-couchbase-caffeine
                       entity: couchbase
                       profile: prod
                       war: 0
                       protractor: 0
+                      testcontainers: 0
                     - app-type: react-gradle-psql-es-noi18n-mapsid
                       entity: sqlfull
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: react-gradle-h2mem-memcached
                       entity: sql
                       profile: dev,webpack
                       war: 1
                       protractor: 1
+                      testcontainers: 0
                     - app-type: react-gradle-cassandra-session-redis
                       entity: cassandra
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
                     - app-type: react-gradle-couchbase-caffeine
                       entity: couchbase
                       profile: prod
                       war: 0
                       protractor: 1
+                      testcontainers: 0
         env:
             JHI_ENTITY: ${{ matrix.entity }}
             JHI_APP: ${{ matrix.app-type }}
             JHI_PROFILE: ${{ matrix.profile }}
             JHI_WAR: ${{ matrix.war }}
             JHI_PROTRACTOR: ${{ matrix.protractor }}
+            JHI_TESTCONTAINERS: ${{ matrix.testcontainers }}
         steps:
             #----------------------------------------------------------------------
             # Install all tools and check configuration
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 554cd77f5f..2915079468 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -76,6 +76,7 @@ jobs:
                   JHI_ENTITY: jdl
                   JHI_PROFILE: prod
                   JHI_PROTRACTOR: 1
+                  JHI_TESTCONTAINERS: 1
       steps:
           #----------------------------------------------------------------------
           # Set checkout path.
diff --git a/generators/ci-cd/templates/.gitlab-ci.yml.ejs b/generators/ci-cd/templates/.gitlab-ci.yml.ejs
index 5f8746cc40..796e5d43b7 100644
--- a/generators/ci-cd/templates/.gitlab-ci.yml.ejs
+++ b/generators/ci-cd/templates/.gitlab-ci.yml.ejs
@@ -80,7 +80,7 @@ gradle-test:
 
 gradle-integration-test:
 <%_ if (insideDocker) { _%>
-    <%_ if (cacheProvider === 'redis' || ['cassandra', 'couchbase', 'neo4j'].includes(prodDatabaseType)) { _%>
+    <%_ if (cacheProvider === 'redis' || ['sql', 'cassandra', 'couchbase', 'neo4j'].includes(databaseType)) { _%>
     # DinD service is required for Testcontainers
     services:
         - docker:dind
@@ -95,7 +95,7 @@ gradle-integration-test:
 
     stage: test
     script:
-        - ./gradlew integrationTest -PnodeInstall --no-daemon
+        - ./gradlew integrationTest -PnodeInstall --no-daemon <% if (insideDocker && databaseType === 'sql' && !reactive) { %>-Ptestcontainers<% } %>
     artifacts:
         reports:
             junit: build/test-results/integrationTest/TEST-*.xml
@@ -199,7 +199,7 @@ maven-compile:
 
 maven-test:
 <%_ if (insideDocker) { _%>
-    <%_ if (cacheProvider === 'redis' || ['cassandra', 'couchbase', 'neo4j'].includes(prodDatabaseType)) { _%>
+    <%_ if (cacheProvider === 'redis' || ['sql', 'cassandra', 'couchbase', 'neo4j'].includes(databaseType)) { _%>
     # DinD service is required for Testcontainers
     services:
         - docker:dind
@@ -214,7 +214,7 @@ maven-test:
 
     stage: test
     script:
-        - ./mvnw -ntp verify -P-webpack -Dmaven.repo.local=$MAVEN_USER_HOME
+        - ./mvnw -ntp verify -P-webpack -Dmaven.repo.local=$MAVEN_USER_HOME <% if (insideDocker && databaseType === 'sql') { %>-Dspring.profiles.active=testcontainers<% } %>
     artifacts:
         reports:
             junit: target/test-results/**/TEST-*.xml
diff --git a/generators/server/files.js b/generators/server/files.js
index bba587c80d..0c67a8be47 100644
--- a/generators/server/files.js
+++ b/generators/server/files.js
@@ -1405,6 +1405,16 @@ const serverFiles = {
             path: SERVER_TEST_RES_DIR,
             templates: ['config/application.yml', 'logback.xml'],
         },
+        {
+            condition: generator => generator.databaseType === 'sql' && !generator.reactive,
+            path: SERVER_TEST_RES_DIR,
+            templates: ['config/application-testcontainers.yml'],
+        },
+        {
+            condition: generator => generator.prodDatabaseType === 'mariadb' && !generator.reactive,
+            path: SERVER_TEST_RES_DIR,
+            templates: [{ file: 'testcontainers/mariadb/my.cnf', method: 'copy', noEjs: true }],
+        },
         {
             // TODO : add these tests to reactive
             condition: generator => !generator.reactive,
diff --git a/generators/server/index.js b/generators/server/index.js
index 10ed26f27b..68bb532a4a 100644
--- a/generators/server/index.js
+++ b/generators/server/index.js
@@ -202,6 +202,30 @@ module.exports = class extends BaseBlueprintGenerator {
                     // sql
                     this.devDatabaseType = configuration.get('devDatabaseType');
                     this.prodDatabaseType = configuration.get('prodDatabaseType');
+
+                    let dbContainer;
+                    switch (this.prodDatabaseType) {
+                        case 'mysql':
+                            dbContainer = this.DOCKER_MYSQL;
+                            break;
+                        case 'mariadb':
+                            dbContainer = this.DOCKER_MARIADB;
+                            break;
+                        case 'postgresql':
+                            dbContainer = this.DOCKER_POSTGRESQL;
+                            break;
+                        case 'mssql':
+                            dbContainer = this.DOCKER_MSSQL;
+                            break;
+                        case 'oracle':
+                        default:
+                            dbContainer = null;
+                    }
+                    if (dbContainer != null && dbContainer.includes(':')) {
+                        this.containerVersion = dbContainer.split(':')[1];
+                    } else {
+                        this.containerVersion = 'latest';
+                    }
                 }
                 this.skipFakeData = configuration.get('skipFakeData') || this.configOptions.skipFakeData;
 
diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs
index 770d9f002e..c5906201f8 100644
--- a/generators/server/templates/build.gradle.ejs
+++ b/generators/server/templates/build.gradle.ejs
@@ -145,6 +145,13 @@ task integrationTest(type: Test) {
     testLogging {
         events 'FAILED', 'SKIPPED'
     }
+
+<%_ if (databaseType === 'sql' && !reactive) { _%>
+    if (project.hasProperty('testcontainers')) {
+        environment 'spring.profiles.active', 'testcontainers'
+    }
+<%_ } _%>
+
     // uncomment if the tests reports are not generated
     // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
     // ignoreFailures true
@@ -408,6 +415,21 @@ dependencies {
     testImplementation "org.testcontainers:neo4j"
     testImplementation 'org.testcontainers:junit-jupiter'
     <%_ } _%>
+    <%_ if (prodDatabaseType === 'mysql' && !reactive) { _%>
+    testImplementation "org.testcontainers:mysql"
+    <%_ } _%>
+    <%_ if (prodDatabaseType === 'mariadb' && !reactive) { _%>
+    testImplementation "org.testcontainers:mariadb"
+    <%_ } _%>
+    <%_ if (prodDatabaseType === 'postgresql' && !reactive) { _%>
+    testImplementation "org.testcontainers:postgresql"
+    <%_ } _%>
+    <%_ if (prodDatabaseType === 'mssql' && !reactive) { _%>
+    testImplementation "org.testcontainers:mssqlserver"
+    <%_ } _%>
+    <%_ if (prodDatabaseType === 'oracle' && !reactive) { _%>
+    testImplementation "org.testcontainers:oracle-xe"
+    <%_ } _%>
     <%_ if (messageBroker === 'kafka') { _%>
         <%_ if (!reactive) { _%>
     implementation "org.apache.kafka:kafka-clients"
diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs
index 54eaeb2c69..3a2df4da6a 100644
--- a/generators/server/templates/pom.xml.ejs
+++ b/generators/server/templates/pom.xml.ejs
@@ -437,6 +437,23 @@
             <scope>test</scope>
         </dependency>
 <%_ } _%>
+<%_ if (databaseType === 'sql' && !reactive) { _%>
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+    <%_ if (prodDatabaseType === 'mysql') { _%>
+            <artifactId>mysql</artifactId>
+    <%_ } else if (prodDatabaseType === 'mariadb') { _%>
+            <artifactId>mariadb</artifactId>
+    <%_ } else if (prodDatabaseType === 'postgresql') { _%>
+            <artifactId>postgresql</artifactId>
+    <%_ } else if (prodDatabaseType === 'mssql') { _%>
+            <artifactId>mssqlserver</artifactId>
+    <%_ } else if (prodDatabaseType === 'oracle') { _%>
+            <artifactId>oracle-xe</artifactId>
+    <%_ } _%>
+            <scope>test</scope>
+        </dependency>
+<%_ } _%>
 <%_ if (['ehcache', 'caffeine', 'hazelcast', 'infinispan', 'memcached'].includes(cacheProvider)) { _%>
         <dependency>
             <groupId>javax.cache</groupId>


Test patch:
diff --git a/generators/server/templates/src/test/resources/config/application-testcontainers.yml.ejs b/generators/server/templates/src/test/resources/config/application-testcontainers.yml.ejs
new file mode 100644
index 0000000000..07427e95f4
--- /dev/null
+++ b/generators/server/templates/src/test/resources/config/application-testcontainers.yml.ejs
@@ -0,0 +1,87 @@
+<%#
+ Copyright 2013-2020 the original author or authors from the JHipster project.
+
+ This file is part of the JHipster project, see https://www.jhipster.tech/
+ for more information.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-%>
+# ===================================================================
+# Spring Boot configuration.
+#
+# This configuration is used for unit/integration tests with testcontainers database containers.
+#
+# To activate this configuration launch integration tests with the 'testcontainers' profile
+#
+# More information on database containers: https://www.testcontainers.org/modules/databases/
+<%_ if (prodDatabaseType === 'mssql') { _%>
+#
+# You are required to accept EULA license for SQL server containers.
+# Follow the instructions at https://www.testcontainers.org/modules/databases/mssqlserver/
+<%_ } _%>
+<%_ if (prodDatabaseType === 'oracle') { _%>
+#
+# You have to specify an Oracle image name in a classpath file named testcontainers.properties.
+# Follow the instructions at https://www.testcontainers.org/modules/databases/oraclexe/
+<%_ } _%>
+# ===================================================================
+
+spring:
+    datasource:
+        type: com.zaxxer.hikari.HikariDataSource
+        driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
+        <%_ if (prodDatabaseType === 'mysql') { _%>
+        url: jdbc:tc:mysql:<%= containerVersion %>:///<%= baseName %>?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=${user.timezone}&TC_TMPFS=/testtmpfs:rw
+        username: root
+        password:
+        <%_ } else if (prodDatabaseType === 'mariadb') { _%>
+        url: jdbc:tc:mariadb:<%= containerVersion %>:///<%= baseName %>?TC_MY_CNF=testcontainers/mariadb&useLegacyDatetimeCode=false&serverTimezone=${user.timezone}&TC_TMPFS=/testtmpfs:rw
+        username: root
+        password:
+        <%_ } else if (prodDatabaseType === 'postgresql') { _%>
+        url: jdbc:tc:postgresql:<%= containerVersion %>:///<%= baseName %>?TC_TMPFS=/testtmpfs:rw
+        username: <%= baseName %>
+        password:
+        <%_ } else if (prodDatabaseType === 'mssql') { _%>
+        url: jdbc:tc:sqlserver:<%= containerVersion %>://;database=<%= baseName %>?TC_TMPFS=/testtmpfs:rw
+        username: SA
+        password: yourStrong(!)Password
+        <%_ } else if (prodDatabaseType === 'oracle') { _%>
+        url: jdbc:tc:oracle:thin:@///ORCL?TC_TMPFS=/testtmpfs:rw
+        username: system
+        password: oracle
+        <%_ } _%>
+        hikari:
+            poolName: Hikari
+            auto-commit: false
+        <%_ if (prodDatabaseType === 'mysql' || prodDatabaseType === 'mariadb' || prodDatabaseType === 'mssql') { _%>
+            data-source-properties:
+                cachePrepStmts: true
+                prepStmtCacheSize: 250
+                prepStmtCacheSqlLimit: 2048
+                useServerPrepStmts: true
+        <%_ } _%>
+    jpa:
+        <%_ if (prodDatabaseType === 'mysql') { _%>
+        database-platform: org.hibernate.dialect.MySQL8Dialect
+        <%_ } else if (prodDatabaseType === 'mariadb') { _%>
+        database-platform: org.hibernate.dialect.MariaDB103Dialect
+        <%_ } else if (prodDatabaseType === 'postgresql') { _%>
+        database-platform: io.github.jhipster.domain.util.FixedPostgreSQL10Dialect
+        <%_ } else if (prodDatabaseType === 'oracle') { _%>
+        database-platform: org.hibernate.dialect.Oracle12cDialect
+        <%_ } else if (prodDatabaseType === 'mssql') { _%>
+        database-platform: org.hibernate.dialect.SQLServer2012Dialect
+        <%_ } else { _%>
+        database-platform: io.github.jhipster.domain.util.FixedH2Dialect
+        <%_ } _%>
diff --git a/generators/server/templates/src/test/resources/config/application.yml.ejs b/generators/server/templates/src/test/resources/config/application.yml.ejs
index 020089fc5e..dea8736eea 100644
--- a/generators/server/templates/src/test/resources/config/application.yml.ejs
+++ b/generators/server/templates/src/test/resources/config/application.yml.ejs
@@ -50,6 +50,11 @@ eureka:
 <%_ } _%>
 
 spring:
+<%_ if (databaseType === 'sql' && !reactive) { _%>
+    profiles:
+        # Uncomment the following line to enable tests against production database type rather than H2, using Testcontainers
+        #active: testcontainers
+<%_ } _%>
     application:
         name: <%= baseName %>
     <%_ if (applicationType === 'gateway' && reactive) { _%>
diff --git a/generators/server/templates/src/test/resources/logback.xml.ejs b/generators/server/templates/src/test/resources/logback.xml.ejs
index 03ca01e723..db84db1456 100644
--- a/generators/server/templates/src/test/resources/logback.xml.ejs
+++ b/generators/server/templates/src/test/resources/logback.xml.ejs
@@ -57,6 +57,10 @@
     <%_ if (databaseType === 'sql' && reactive) { _%>
     <logger name="io.r2dbc" level="WARN"/>
     <%_ } _%>
+    <%_ if (databaseType === 'sql') { _%>
+    <logger name="com.github.dockerjava" level="WARN"/>
+    <logger name="org.testcontainers" level="WARN"/>
+    <%_ } _%>
     <%_ if (!reactive) { _%>
     <logger name="io.undertow" level="WARN"/>
     <logger name="io.undertow.websockets.jsr" level="ERROR"/>
diff --git a/generators/server/templates/src/test/resources/testcontainers/mariadb/my.cnf b/generators/server/templates/src/test/resources/testcontainers/mariadb/my.cnf
new file mode 100644
index 0000000000..194faef5c1
--- /dev/null
+++ b/generators/server/templates/src/test/resources/testcontainers/mariadb/my.cnf
@@ -0,0 +1,2 @@
+[mysqld]
+character-set-server = utf8mb4
diff --git a/test-integration/scripts/21-tests-backend.sh b/test-integration/scripts/21-tests-backend.sh
index 4ff10472a9..9aa42cf748 100755
--- a/test-integration/scripts/21-tests-backend.sh
+++ b/test-integration/scripts/21-tests-backend.sh
@@ -47,13 +47,24 @@ if [[ "$JHI_APP" == *"uaa"* ]]; then
     ./mvnw -ntp verify --batch-mode
 fi
 
+#-------------------------------------------------------------------------------
+# Enable testcontainers profiles
+#-------------------------------------------------------------------------------
+JHI_GRADLE_ENABLE_TESTCONTAINERS=""
+JHI_MAVEN_ENABLE_TESTCONTAINERS=""
+if [ "$JHI_TESTCONTAINERS" == 1 ]; then
+    JHI_GRADLE_ENABLE_TESTCONTAINERS="-Ptestcontainers"
+    JHI_MAVEN_ENABLE_TESTCONTAINERS="-Dspring.profiles.active=testcontainers"
+fi
+
 #-------------------------------------------------------------------------------
 # Launch tests
 #-------------------------------------------------------------------------------
 cd "$JHI_FOLDER_APP"
 if [ -f "mvnw" ]; then
-    ./mvnw -ntp -P-webpack verify --batch-mode \
+    ./mvnw -ntp -P-webpack verify $JHI_MAVEN_ENABLE_TESTCONTAINERS --batch-mode \
         -Dlogging.level.ROOT=OFF \
+        -Dlogging.level.org.testcontainers=INFO \
         -Dlogging.level.org.zalando=OFF \
         -Dlogging.level.io.github.jhipster=OFF \
         -Dlogging.level.io.github.jhipster.sample=OFF \
@@ -62,8 +73,9 @@ if [ -f "mvnw" ]; then
         -Dlogging.level.org.springframework.security=OFF
 
 elif [ -f "gradlew" ]; then
-    ./gradlew test integrationTest $JHI_GRADLE_EXCLUDE_WEBPACK \
+    ./gradlew test integrationTest $JHI_GRADLE_EXCLUDE_WEBPACK $JHI_GRADLE_ENABLE_TESTCONTAINERS \
         -Dlogging.level.ROOT=OFF \
+        -Dlogging.level.org.testcontainers=INFO \
         -Dlogging.level.org.zalando=OFF \
         -Dlogging.level.io.github.jhipster=OFF \
         -Dlogging.level.io.github.jhipster.sample=OFF \
diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js
index 6af40c14f9..b8865e646d 100644
--- a/test/utils/expected-files.js
+++ b/test/utils/expected-files.js
@@ -696,13 +696,30 @@ const expectedFiles = {
         `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/repository/timezone/DateTimeWrapperRepository.java`,
     ],
 
-    mysql: [`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`, `${DOCKER_DIR}mysql.yml`],
+    mysql: [
+        `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`,
+        `${DOCKER_DIR}mysql.yml`,
+        `${SERVER_TEST_RES_DIR}/config/application-testcontainers.yml`,
+    ],
 
-    mariadb: [`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`, `${DOCKER_DIR}mariadb.yml`],
+    mariadb: [
+        `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`,
+        `${DOCKER_DIR}mariadb.yml`,
+        `${SERVER_TEST_RES_DIR}/config/application-testcontainers.yml`,
+        `${SERVER_TEST_RES_DIR}/testcontainers/mariadb/my.cnf`,
+    ],
 
-    mssql: [`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`, `${DOCKER_DIR}mssql.yml`],
+    mssql: [
+        `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`,
+        `${DOCKER_DIR}mssql.yml`,
+        `${SERVER_TEST_RES_DIR}/config/application-testcontainers.yml`,
+    ],
 
-    postgresql: [`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`, `${DOCKER_DIR}postgresql.yml`],
+    postgresql: [
+        `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/LiquibaseConfiguration.java`,
+        `${DOCKER_DIR}postgresql.yml`,
+        `${SERVER_TEST_RES_DIR}/config/application-testcontainers.yml`,
+    ],
 
     liquibase: [
         `${SERVER_MAIN_RES_DIR}config/liquibase/master.xml`,