junit5 icon indicating copy to clipboard operation
junit5 copied to clipboard

fix #944: provide the resolved parameters in the ExtensionContext

Open t1 opened this issue 1 year ago • 0 comments

Overview

As (almost) suggested in #944, I've added a method ExtensionContext#getResolvedParameters (and getRequiredResolvedParameters) and an interface ResolvedParameters. The AbstractExtensionContext can store and return those. The ParameterResolutionUtils store them, but I had to introduce another but internal interface ResolvedParametersStore to make this possible without hurting the visibility scopes between descriptor and execution.

The problem I ran into is that TestMethodTestDescriptor#execute calls the parameter resolvers after all BeforeEach callbacks and methods. So they can't see them, but that was the purpose of it all.

I'm not sure, if this ordering could be inverted: first the parameter resolvers, then the BeforeEach handling.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

t1 avatar Aug 17 '24 09:08 t1