Quarkus: Override property values in application.properties during Unit Tests

Created on 20 Feb 2020  路  5Comments  路  Source: quarkusio/quarkus

Is that a way to change a property value for unit tests?
Example quarkus.mongodb.database, wanna change it in QuarkusTest but leave the original value unchanged.

kinquestion

All 5 comments

QuarkusTest uses the test profile, so you can override the property inside your application.properties like that:

%test.quarkus.mongodb.database=test

Closing since the answer by @loicmathieu is spot on

Thanks it works :)

Sorry for the question for the closed issue.
But what if I want to set different values for the different test classes?

Then you have to wait for Quarkus 1.6 which introduces the notion of QuarkusTestProfile

Was this page helpful?
0 / 5 - 0 ratings