I have configured the test
application properties to use Postgresql. All tests seem to work but that is not totally correct.
When I do actual persistent data tests, there is no data being saved to the postgresql db even though liquibase is run.
Relevant section of application.yml
that I've configured with postgresql.
spring:
application:
name: stackoverflow
jackson:
serialization.write_dates_as_timestamps: false
cache:
type: none
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://127.0.0.1:5432/store_test?user=postgres
jpa:
database-platform: io.github.jhipster.domain.util.FixedPostgreSQL82Dialect
database: POSTGRESQL
show-sql: false
generate-ddl: false
hibernate:
ddl-auto: none
properties:
hibernate.id.new_generator_mappings: true
hibernate.cache.use_second_level_cache: false
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: true
As per normal there is a createEntity
method for say an Entity Company
I have tried
em.persist(company)
em.flush(company)
also
companyRepository.saveAndFlush(company)
What am I missing to get JHipster to correct test against a real database or if I am saving data incorrectly.