Skip to content

Commit

Permalink
Provide a hint for when @QuarkusTest and @QuarkusIntegrationTest are …
Browse files Browse the repository at this point in the history
…mixed

Closes: #28526

Co-authored-by: Falko Modler <[email protected]>
(cherry picked from commit aeb4d75)
  • Loading branch information
geoand authored and gsmet committed Oct 18, 2022
1 parent 132047d commit 8ef74ec
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ static void doProcessTestInstance(Object testInstance, ExtensionContext context)
ExtensionContext.Store store = root.getStore(ExtensionContext.Namespace.GLOBAL);
QuarkusTestExtensionState state = store.get(QuarkusTestExtensionState.class.getName(),
QuarkusTestExtensionState.class);
Object testResourceManager = state.testResourceManager;
if (!(testResourceManager instanceof TestResourceManager)) {
throw new RuntimeException(
"An unexpected situation occurred while trying to instantiate the testing infrastructure. Have you perhaps mixed @QuarkusTest and @QuarkusIntegrationTest in the same test run?");
}
((TestResourceManager) state.testResourceManager).inject(testInstance);
}

Expand Down

0 comments on commit 8ef74ec

Please sign in to comment.