I encountered the same issue, so I implemented the following solution to pass my tests. All my endpoints are annotated with @IfBuildProfile. For my tests, I used the @QuarkusTest annotation (I’m not sure if this would work with @QuarkusIntegrationTest).
To handle different profiles, I created two utility classes for my profiles, which look like this:
class ReadTestProfile : QuarkusTestProfile { override fun getConfigProfile(): String { return "read" // Activate the "read" profile } }
Then, for my tests, I annotated them with @TestProfile(ReadTestProfile::class). When the test runs, the build profile, which is set by default to test, changes, and I see the following log message:
INFO [io.quarkus] (main) Profile read activated. This confirms that the read profile is being used during the test.