Skip to content

Commit a3d36fd

Browse files
committed
testContainer:
define basic dependency and config for use testContainer
1 parent c8811e3 commit a3d36fd

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@
153153
<version>3.0.8</version>
154154
</dependency>
155155

156+
<!-- testContainer -->
157+
<dependency>
158+
<groupId>org.testcontainers</groupId>
159+
<artifactId>postgresql</artifactId>
160+
<version>1.16.0</version>
161+
<scope>test</scope>
162+
</dependency>
163+
156164
<!-- swagger-UI -->
157165
<dependency>
158166
<groupId>org.springdoc</groupId>

src/test/resources/application-test.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
################### Server Configuration ##########################
22
server.port=9090
33

4-
5-
################### DataSource Configuration ##########################
6-
demo.datasource.driver-class-name=org.postgresql.Driver
7-
demo.datasource.url=jdbc:postgresql://localhost:5432/myapp
8-
demo.datasource.username=postgres
9-
demo.datasource.password=postgres
4+
################### TestContainers DATABASE CONFIGURATION ###################
5+
demo.datasource.url=jdbc:tc:postgresql:latest://localhost/myapp
6+
demo.datasource.username=user
7+
demo.datasource.password=password
8+
demo.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver
9+
demo.datasource.max-active=1
1010

1111
################### Hibernate Configuration ##########################
1212
demo.jpa.hibernate.ddl-auto=update

0 commit comments

Comments
 (0)