Skip to content

Commit

Permalink
Add Test Container βœοΈπŸ“— :octocat: πŸ³β¬†
Browse files Browse the repository at this point in the history
  • Loading branch information
hendisantika committed Apr 15, 2024
1 parent 994ae9c commit 3928f6c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.testcontainers.junit.jupiter.Testcontainers;

@SpringBootTest
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
@Testcontainers
class SekolahApplicationTests {

@Test
Expand Down
9 changes: 9 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spring:
datasource:
url: jdbc:tc:postgresql:16.2-alpine3.19:///sekolah
username: yuji
password: itadori
jpa:
hibernate:
ddl-auto: validate
show-sql: true

0 comments on commit 3928f6c

Please sign in to comment.