-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability for InvocationInterceptor to intercept argument providers #2579
Comments
Tentatively slated for 5.8-M2 solely for the purpose of team discussion |
One of the challenges here is that Whereas, Thus, |
We could add a new |
@marcphilipp, your proposal is somewhat related to #2191. If we implement a solution for #2191, that would likely result in a means for invoking any method using parameter resolvers, analogous to what So there may be room for synergies here. |
Also related to #1139. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution. |
This is not stale. Quarkus is still waiting for this and has to apply brittle object cloning as a workaround. |
Ran into this issue today. |
I think we should address #3028 first as it might solve the problem more cleanly. @stuartwdouglas Could you please point us to Quarkus' |
@marcphilipp you can find the main usage in https://github.com/quarkusio/quarkus/blob/2.13.3.Final/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusTestExtension.java. As you see in the various intercept methods use an instance of the test class created by Quarkus (which is created in |
I should also add for context that Quarkus needed to go down this route, because it applies various transformations to classes and without using a custom ClassLoader and different test instance, the transformations could fail to be applied. |
I'll have a look, thanks! |
Quarkus needs to run tests in its own
ClassLoader
, and it achieves this by intercepting all methods throughInvocationInterceptor
and redirecting them to a new test instance loaded from the QuarkusClassLoader
.This works really well with the exception of
@MethodSource
based parameters. As there is no way to intercept that the method is invoked on the original instance, and the parameters may be loaded from the wrongClassLoader
.It would be great if we could have some additional methods added to
InvocationInterceptor
to intercept this invocation as well.Related Issues
The text was updated successfully, but these errors were encountered: