Skip to content

Commit e48d32e

Browse files
committed
Add support to H2 for making internal tests in TravisCI.
1 parent a733319 commit e48d32e

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
<artifactId>jjwt</artifactId>
5555
<version>${jjwt.version}</version>
5656
</dependency>
57+
<dependency>
58+
<groupId>com.h2database</groupId>
59+
<artifactId>h2</artifactId>
60+
<scope>runtime</scope>
61+
</dependency>
5762
</dependencies>
5863

5964

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# configura banco in memory H2
2+
spring.jpa.hibernate.ddl-auto=create
3+
spring.datasource.driver-class-name=org.h2.Driver
4+
spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
5+
spring.datasource.username=sa
6+
spring.datasource.password=sa

src/test/java/com/fmpnazareth/expensemagement/TestBackJavaApplicationTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import org.junit.Test;
44
import org.junit.runner.RunWith;
55
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.ActiveProfiles;
67
import org.springframework.test.context.junit4.SpringRunner;
78

89
@RunWith(SpringRunner.class)
910
@SpringBootTest
11+
@ActiveProfiles("test")
1012
public class TestBackJavaApplicationTests {
1113

1214
@Test

0 commit comments

Comments
 (0)