Skip to content

Commit b56f6ca

Browse files
committed
add h2 dependency for test
1 parent d76922e commit b56f6ca

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@
133133
<groupId>org.springframework.modulith</groupId>
134134
<artifactId>spring-modulith-starter-jpa</artifactId>
135135
</dependency>
136+
<dependency>
137+
<groupId>com.h2database</groupId>
138+
<artifactId>h2</artifactId>
139+
<scope>test</scope>
140+
</dependency>
141+
142+
<dependency>
143+
<groupId>com.h2database</groupId>
144+
<artifactId>h2</artifactId>
145+
<scope>runtime</scope>
146+
</dependency>
147+
136148
</dependencies>
137149

138150
<build>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spring.datasource.url=jdbc:h2:mem:testdb
2+
spring.datasource.driverClassName=org.h2.Driver
3+
spring.datasource.username=sa
4+
spring.datasource.password=
5+
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
6+
spring.jpa.hibernate.ddl-auto=create-drop

src/test/java/demo/codeexample/CodeExampleApplicationTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import org.junit.jupiter.api.Test;
44
import org.springframework.boot.test.context.SpringBootTest;
5+
import org.springframework.test.context.ActiveProfiles;
56

67
@SpringBootTest
8+
@ActiveProfiles("test")
79
class CodeExampleApplicationTests {
810

911
@Test

0 commit comments

Comments
 (0)