You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by alanwong-toast July 22, 2024
I was hoping that ExecutableInvoker (accessible from ExtensionContext) would allow for the invocation of methods/classes with the currently known set of ParameterResolvers, but based on my testing, it seems that it only loads with a default set of resolvers and never the resolvers I have injected.
The creation of the DefaultExecutableInvoker happens here:
It appears that the new extension registry generated from populateNewExtensionRegistryFromExtendWithAnnotation at the top is never passed into the new context that is used to construct the class's context.
This results in a default set of resolvers in all cases, regardless of which extension interface I use to get the extension context.
Is there a correct way to utilize ExecutableInvoker such that the context of the currently running test has access to that test's ParameterResolvers?
The text was updated successfully, but these errors were encountered:
Discussed in #3896
Originally posted by alanwong-toast July 22, 2024
I was hoping that ExecutableInvoker (accessible from
ExtensionContext
) would allow for the invocation of methods/classes with the currently known set ofParameterResolvers
, but based on my testing, it seems that it only loads with a default set of resolvers and never the resolvers I have injected.The creation of the
DefaultExecutableInvoker
happens here:junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java
Lines 149 to 151 in ae20d63
junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java
Lines 179 to 192 in ae20d63
With this constructor for
DefaultExecutableInvoker
:junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultExecutableInvoker.java
Lines 40 to 42 in ae20d63
It appears that the new extension registry generated from
populateNewExtensionRegistryFromExtendWithAnnotation
at the top is never passed into the new context that is used to construct the class's context.This results in a default set of resolvers in all cases, regardless of which extension interface I use to get the extension context.
Is there a correct way to utilize
ExecutableInvoker
such that the context of the currently running test has access to that test'sParameterResolvers
?The text was updated successfully, but these errors were encountered: