I currently have a spring boot application that contains 2 configuration files: application.yaml and application-test.yaml . The test application profile is loaded correctly, and any settings in this file work properly.
However, I have a problem with one parameter, in particular spring.jpa.hibernate.ddl-auto = 'update'. When this parameter is defined in the application.yaml file , it crashes my JPA unit tests with the exception “PG_CLASS table not found”. I tried to override this parameter with different values in the application-application configuration file to no avail.
My complete configuration files are as follows:
application.yaml
spring.datasource.driverClassName: org.postgresql.Driver
spring.datasource.url: jdbc:postgresql://ec2-54-75-233-146.eu-west-1.compute.amazonaws.com:5432/xxxx?user=xxxx&password=xxxxx&sslmode=require
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults: false
spring.jpa.database-platform: org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto: update
test.yaml applications
spring.datasource.usernam: sa
spring.datasource.url: jdbc:h2:mem:tests;DB_CLOSE_DELAY=-1;MODE=PostgreSQL;DB_CLOSE_ON_EXIT=FALSE;
spring.datasource.driverClassName: org.h2.Driver
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_default: false
spring.jpa.database-platform: org.hibernate.dialect.H2
Uncommenting the "spring.jpa.hibernate.ddl-auto: update" parameter in my application.yaml file fixes the problem. But I would like it to be included. Any ideas?
source
share