Skip to content

QuarkusUnitTest#overrideConfigKey() is ignored if the test archive already contains an "application.properties" asset #43129

Closed
@mkouba

Description

@mkouba

Describe the bug

There seems to be a bug in the ShrinkWrap project - if you use both archive.addAsResource(new StringAsset("quarkus.property=false"),"application.properties") and testConfig.overrideConfigKey("quarkus.property", "true") then the value from the application.properties asset is taken.

Expected behavior

I think that at the very least we should:

  1. Clarify the javadoc of QuarkusUnitTest#overrideConfigKey(), and,
  2. Either fail the test or log a warning if both addResource() and overrideConfigKey() are used.

Ideally, we would merge the existing application.properties asset and the overriden config properties but I'm not sure how complicated that could be.

Actual behavior

The overriden config properties are ignored, no warning is logged.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions