Skip to content

Use overrideConfigKey to test Hibernate tests instead of application.properties files #51206

@lucamolteni

Description

@lucamolteni

Description

In Hibernate Extensions tests (both blocking and reactive) the test configuration is currently split between two mechanisms:

  • application.properties files
  • overrideConfigKey calls inside the test code

overrideConfigKey is preferable as it keeps configuration close to the test and makes test intent explicit

application.properties files are still used due to test container connection string interpolation. It's the only way to inject the connection string from the Maven properties expressed like this

quarkus.datasource.reactive.url=${postgres.reactive.url}

The ${key} syntax won't work inside Java code.

However, after the merge of PR #51066, tests use dev services, so we don't need a test container connection string URL anymore.

As a result, we can stop using application.properties in these tests and rely solely on overrideConfigKey, which should simplify the test

Implementation ideas

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions