diff --git a/src/main/resources/application-mysql.properties b/src/main/resources/application-mysql.properties index 30987a5..4851880 100644 --- a/src/main/resources/application-mysql.properties +++ b/src/main/resources/application-mysql.properties @@ -5,8 +5,11 @@ spring.datasource.username=${MYSQL_USER:sakila} spring.datasource.password=${MYSQL_PASS:Sakila@121} # SQL is written to be idempotent so this is safe #spring.datasource.initialization-mode=always +# # JPA spring.jpa.hibernate.ddl-auto=none +#spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect +# # Logging logging.level.org.springframework=INFO # logging.level.org.springframework.web=DEBUG diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b5c8329..c85d639 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,6 @@ spring.profiles.active=h2 +#spring.profiles.active=mysql +# # database config database=h2 spring.datasource.schema=classpath*:db/${database}/sakila-schema.sql @@ -6,9 +8,15 @@ spring.datasource.data=classpath*:db/${database}/sakila-data.sql spring.datasource.url=jdbc:h2:mem:sakila;MODE=MYSQL spring.h2.console.enabled=true #spring.datasource.initialization-mode=always +# +# https://github.com/spring-projects/spring-boot/issues/1454 +spring.datasource.continueOnError=true +# # JPA spring.jpa.hibernate.ddl-auto=none spring.jpa.open-in-view=false +#spring.jpa.show-sql=true +# # Logging logging.level.org.springframework=INFO # logging.level.org.springframework.web=DEBUG diff --git a/src/test/java/vn/com/ezmobi/ezhealth/ezhuserservice/services/CountryServiceTest.java b/src/test/java/vn/com/ezmobi/ezhealth/ezhuserservice/services/CountryServiceTest.java index afce2fc..81e3415 100644 --- a/src/test/java/vn/com/ezmobi/ezhealth/ezhuserservice/services/CountryServiceTest.java +++ b/src/test/java/vn/com/ezmobi/ezhealth/ezhuserservice/services/CountryServiceTest.java @@ -27,13 +27,11 @@ /** * Ref: * https://www.baeldung.com/junit-assertions - * https://www.baeldung.com/spring-boot-exclude-auto-configuration-test - * https://javarevisited.blogspot.com/2019/04/spring-boot-error-error-creating-bean.html#axzz6jZMAb89u + * https://github.com/spring-projects/spring-boot/issues/1454 *
* Created by ezmobivietnam on 2021-01-12. */ @SpringBootTest -//@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) class CountryServiceTest { @MockBean