Skip to content

Commit ee8a4fe

Browse files
committed
Update tests
1 parent 66a1fb1 commit ee8a4fe

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

google-cloud-sql/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@
111111
<optional>true</optional>
112112
</dependency>
113113

114+
<dependency>
115+
<groupId>com.h2database</groupId>
116+
<artifactId>h2</artifactId>
117+
<scope>test</scope>
118+
</dependency>
114119
<dependency>
115120
<groupId>org.springframework.boot</groupId>
116121
<artifactId>spring-boot-starter-test</artifactId>

google-cloud-sql/src/test/java/org/squidmin/java/spring/maven/cloudsql/actuator/ActuatorTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
1414
properties = {
1515
"management.endpoints.web.exposure.include=health,info",
16-
// show details so JSON has components (optional)
17-
"management.endpoint.health.show-details=always"
16+
"management.endpoint.health.show-details=always",
17+
"spring.datasource.url=jdbc:h2:mem:testdb;MODE=PostgreSQL;DB_CLOSE_DELAY=-1",
18+
"spring.datasource.driver-class-name=org.h2.Driver",
19+
"spring.jpa.hibernate.ddl-auto=none"
1820
}
1921
)
2022
public class ActuatorTest {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
spring:
22
application:
33
name: google-cloud-sql
4+
datasource:
5+
url: jdbc:postgresql://127.0.0.1:5400/jm_demo_db
6+
username: username
7+
password: ${DB_PASSWORD:password}
8+
driver-class-name: org.postgresql.Driver
9+
hikari:
10+
maximum-pool-size: 10
11+
minimum-idle: 2
12+
13+
jpa:
14+
open-in-view: false
15+
hibernate:
16+
ddl-auto: none
17+
properties:
18+
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect

0 commit comments

Comments
 (0)