Skip to content

Commit b693945

Browse files
authored
Use current context and registry when instantiating ExecutableInvoker
Fixes #3905.
1 parent 8e067d3 commit b693945

15 files changed

+73
-51
lines changed

documentation/src/docs/asciidoc/release-notes/release-notes-5.11.0-RC1.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ repository on GitHub.
4444

4545
* `TestInstancePostProcessor` extensions can now be registered via the `@ExtendWith`
4646
annotation on non-static fields.
47+
* Methods and constructors invoked via `ExecutableInvoker` now use the same extensions as
48+
the context they are invoked from and the same `ExtensionContext` is passed to
49+
registered instances of `ParameterResolver`.
4750

4851
[[release-notes-5.11.0-RC1-junit-jupiter-deprecations-and-breaking-changes]]
4952
==== Deprecations and Breaking Changes

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/AbstractExtensionContext.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ abstract class AbstractExtensionContext<T extends TestDescriptor> implements Ext
5555
private final ExecutableInvoker executableInvoker;
5656

5757
AbstractExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener, T testDescriptor,
58-
JupiterConfiguration configuration, ExecutableInvoker executableInvoker) {
59-
this.executableInvoker = executableInvoker;
58+
JupiterConfiguration configuration,
59+
Function<ExtensionContext, ExecutableInvoker> executableInvokerFactory) {
60+
this.executableInvoker = executableInvokerFactory.apply(this);
6061

6162
Preconditions.notNull(testDescriptor, "TestDescriptor must not be null");
6263
Preconditions.notNull(configuration, "JupiterConfiguration must not be null");

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.junit.jupiter.api.TestInstance.Lifecycle;
4040
import org.junit.jupiter.api.extension.AfterAllCallback;
4141
import org.junit.jupiter.api.extension.BeforeAllCallback;
42-
import org.junit.jupiter.api.extension.ExecutableInvoker;
4342
import org.junit.jupiter.api.extension.Extension;
4443
import org.junit.jupiter.api.extension.ExtensionConfigurationException;
4544
import org.junit.jupiter.api.extension.ExtensionContext;
@@ -179,10 +178,9 @@ public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext conte
179178
registerExtensionsFromInstanceFields(registry, this.testClass);
180179

181180
ThrowableCollector throwableCollector = createThrowableCollector();
182-
ExecutableInvoker executableInvoker = new DefaultExecutableInvoker(context);
183181
ClassExtensionContext extensionContext = new ClassExtensionContext(context.getExtensionContext(),
184182
context.getExecutionListener(), this, this.lifecycle, context.getConfiguration(), throwableCollector,
185-
executableInvoker);
183+
it -> new DefaultExecutableInvoker(it, registry));
186184

187185
// @formatter:off
188186
return context.extend()

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassExtensionContext.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.lang.reflect.AnnotatedElement;
1414
import java.lang.reflect.Method;
1515
import java.util.Optional;
16+
import java.util.function.Function;
1617

1718
import org.junit.jupiter.api.TestInstance.Lifecycle;
1819
import org.junit.jupiter.api.extension.ExecutableInvoker;
@@ -38,21 +39,23 @@ final class ClassExtensionContext extends AbstractExtensionContext<ClassBasedTes
3839
* Create a new {@code ClassExtensionContext} with {@link Lifecycle#PER_METHOD}.
3940
*
4041
* @see #ClassExtensionContext(ExtensionContext, EngineExecutionListener, ClassBasedTestDescriptor,
41-
* Lifecycle, JupiterConfiguration, ThrowableCollector, ExecutableInvoker)
42+
* Lifecycle, JupiterConfiguration, ThrowableCollector, Function)
4243
*/
4344
ClassExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener,
4445
ClassBasedTestDescriptor testDescriptor, JupiterConfiguration configuration,
45-
ThrowableCollector throwableCollector, ExecutableInvoker executableInvoker) {
46+
ThrowableCollector throwableCollector,
47+
Function<ExtensionContext, ExecutableInvoker> executableInvokerFactory) {
4648

4749
this(parent, engineExecutionListener, testDescriptor, Lifecycle.PER_METHOD, configuration, throwableCollector,
48-
executableInvoker);
50+
executableInvokerFactory);
4951
}
5052

5153
ClassExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener,
5254
ClassBasedTestDescriptor testDescriptor, Lifecycle lifecycle, JupiterConfiguration configuration,
53-
ThrowableCollector throwableCollector, ExecutableInvoker executableInvoker) {
55+
ThrowableCollector throwableCollector,
56+
Function<ExtensionContext, ExecutableInvoker> executableInvokerFactory) {
5457

55-
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvoker);
58+
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvokerFactory);
5659

5760
this.lifecycle = lifecycle;
5861
this.throwableCollector = throwableCollector;

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicExtensionContext.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.lang.reflect.AnnotatedElement;
1414
import java.lang.reflect.Method;
1515
import java.util.Optional;
16+
import java.util.function.Function;
1617

1718
import org.junit.jupiter.api.TestInstance;
1819
import org.junit.jupiter.api.extension.ExecutableInvoker;
@@ -26,8 +27,8 @@ class DynamicExtensionContext extends AbstractExtensionContext<DynamicNodeTestDe
2627

2728
DynamicExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener,
2829
DynamicNodeTestDescriptor testDescriptor, JupiterConfiguration configuration,
29-
ExecutableInvoker executableInvoker) {
30-
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvoker);
30+
Function<ExtensionContext, ExecutableInvoker> executableInvokerFactory) {
31+
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvokerFactory);
3132
}
3233

3334
@Override

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicNodeTestDescriptor.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public String getLegacyReportingName() {
4646
@Override
4747
public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) {
4848
DynamicExtensionContext extensionContext = new DynamicExtensionContext(context.getExtensionContext(),
49-
context.getExecutionListener(), this, context.getConfiguration(), new DefaultExecutableInvoker(context));
49+
context.getExecutionListener(), this, context.getConfiguration(),
50+
it -> new DefaultExecutableInvoker(it, context.getExtensionRegistry()));
5051
// @formatter:off
5152
return context.extend()
5253
.withExtensionContext(extensionContext)

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineDescriptor.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import static org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.toExecutionMode;
1515

1616
import org.apiguardian.api.API;
17-
import org.junit.jupiter.api.extension.ExecutableInvoker;
1817
import org.junit.jupiter.api.extension.ExtensionContext;
1918
import org.junit.jupiter.engine.config.JupiterConfiguration;
2019
import org.junit.jupiter.engine.execution.DefaultExecutableInvoker;
@@ -53,9 +52,8 @@ public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext conte
5352
MutableExtensionRegistry extensionRegistry = MutableExtensionRegistry.createRegistryWithDefaultExtensions(
5453
context.getConfiguration());
5554
EngineExecutionListener executionListener = context.getExecutionListener();
56-
ExecutableInvoker executableInvoker = new DefaultExecutableInvoker(context);
5755
ExtensionContext extensionContext = new JupiterEngineExtensionContext(executionListener, this,
58-
context.getConfiguration(), executableInvoker);
56+
context.getConfiguration(), it -> new DefaultExecutableInvoker(it, extensionRegistry));
5957

6058
// @formatter:off
6159
return context.extend()

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineExtensionContext.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
import java.lang.reflect.AnnotatedElement;
1414
import java.lang.reflect.Method;
1515
import java.util.Optional;
16+
import java.util.function.Function;
1617

1718
import org.junit.jupiter.api.TestInstance.Lifecycle;
1819
import org.junit.jupiter.api.extension.ExecutableInvoker;
20+
import org.junit.jupiter.api.extension.ExtensionContext;
1921
import org.junit.jupiter.api.extension.TestInstances;
2022
import org.junit.jupiter.engine.config.JupiterConfiguration;
2123
import org.junit.platform.engine.EngineExecutionListener;
@@ -28,9 +30,9 @@ final class JupiterEngineExtensionContext extends AbstractExtensionContext<Jupit
2830

2931
JupiterEngineExtensionContext(EngineExecutionListener engineExecutionListener,
3032
JupiterEngineDescriptor testDescriptor, JupiterConfiguration configuration,
31-
ExecutableInvoker executableInvoker) {
33+
Function<ExtensionContext, ExecutableInvoker> executableInvokerFactory) {
3234

33-
super(null, engineExecutionListener, testDescriptor, configuration, executableInvoker);
35+
super(null, engineExecutionListener, testDescriptor, configuration, executableInvokerFactory);
3436
}
3537

3638
@Override

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodExtensionContext.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.lang.reflect.AnnotatedElement;
1414
import java.lang.reflect.Method;
1515
import java.util.Optional;
16+
import java.util.function.Function;
1617

1718
import org.junit.jupiter.api.TestInstance.Lifecycle;
1819
import org.junit.jupiter.api.extension.ExecutableInvoker;
@@ -34,9 +35,10 @@ final class MethodExtensionContext extends AbstractExtensionContext<TestMethodTe
3435

3536
MethodExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener,
3637
TestMethodTestDescriptor testDescriptor, JupiterConfiguration configuration,
37-
ThrowableCollector throwableCollector, ExecutableInvoker executableInvoker) {
38+
ThrowableCollector throwableCollector,
39+
Function<ExtensionContext, ExecutableInvoker> executableInvokerFactory) {
3840

39-
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvoker);
41+
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvokerFactory);
4042

4143
this.throwableCollector = throwableCollector;
4244
}

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestMethodTestDescriptor.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
2525
import org.junit.jupiter.api.extension.BeforeEachCallback;
2626
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback;
27-
import org.junit.jupiter.api.extension.ExecutableInvoker;
2827
import org.junit.jupiter.api.extension.Extension;
2928
import org.junit.jupiter.api.extension.ExtensionContext;
3029
import org.junit.jupiter.api.extension.InvocationInterceptor;
@@ -99,9 +98,9 @@ public Type getType() {
9998
public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) {
10099
MutableExtensionRegistry registry = populateNewExtensionRegistry(context);
101100
ThrowableCollector throwableCollector = createThrowableCollector();
102-
ExecutableInvoker executableInvoker = new DefaultExecutableInvoker(context);
103101
MethodExtensionContext extensionContext = new MethodExtensionContext(context.getExtensionContext(),
104-
context.getExecutionListener(), this, context.getConfiguration(), throwableCollector, executableInvoker);
102+
context.getExecutionListener(), this, context.getConfiguration(), throwableCollector,
103+
it -> new DefaultExecutableInvoker(it, registry));
105104
throwableCollector.execute(() -> {
106105
TestInstances testInstances = context.getTestInstancesProvider().getTestInstances(registry,
107106
throwableCollector);

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateExtensionContext.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.lang.reflect.AnnotatedElement;
1414
import java.lang.reflect.Method;
1515
import java.util.Optional;
16+
import java.util.function.Function;
1617

1718
import org.junit.jupiter.api.TestInstance.Lifecycle;
1819
import org.junit.jupiter.api.extension.ExecutableInvoker;
@@ -31,9 +32,9 @@ final class TestTemplateExtensionContext extends AbstractExtensionContext<TestTe
3132

3233
TestTemplateExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener,
3334
TestTemplateTestDescriptor testDescriptor, JupiterConfiguration configuration, TestInstances testInstances,
34-
ExecutableInvoker executableInvoker) {
35+
Function<ExtensionContext, ExecutableInvoker> executableInvokerFactory) {
3536

36-
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvoker);
37+
super(parent, engineExecutionListener, testDescriptor, configuration, executableInvokerFactory);
3738
this.testInstances = testInstances;
3839
}
3940

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.concurrent.atomic.AtomicInteger;
2222

2323
import org.apiguardian.api.API;
24-
import org.junit.jupiter.api.extension.ExecutableInvoker;
2524
import org.junit.jupiter.api.extension.ExtensionContext;
2625
import org.junit.jupiter.api.extension.TestInstances;
2726
import org.junit.jupiter.api.extension.TestTemplateInvocationContext;
@@ -81,9 +80,9 @@ public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext conte
8180
// The test instance should be properly maintained by the enclosing class's ExtensionContext.
8281
TestInstances testInstances = context.getExtensionContext().getTestInstances().orElse(null);
8382

84-
ExecutableInvoker executableInvoker = new DefaultExecutableInvoker(context);
8583
ExtensionContext extensionContext = new TestTemplateExtensionContext(context.getExtensionContext(),
86-
context.getExecutionListener(), this, context.getConfiguration(), testInstances, executableInvoker);
84+
context.getExecutionListener(), this, context.getConfiguration(), testInstances,
85+
it -> new DefaultExecutableInvoker(it, registry));
8786

8887
// @formatter:off
8988
return context.extend()

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultExecutableInvoker.java

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ public DefaultExecutableInvoker(ExtensionContext extensionContext, ExtensionRegi
3737
this.extensionRegistry = extensionRegistry;
3838
}
3939

40-
public DefaultExecutableInvoker(JupiterEngineExecutionContext context) {
41-
this(context.getExtensionContext(), context.getExtensionRegistry());
42-
}
43-
4440
@Override
4541
public <T> T invoke(Constructor<T> constructor, Object outerInstance) {
4642
Object[] arguments = resolveParameters(constructor, Optional.empty(), Optional.ofNullable(outerInstance),

junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExecutableInvokerIntegrationTests.java

+22-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ static class ExecuteTestsTwiceTestCase {
4545
static int testInvocations = 0;
4646

4747
@Test
48-
void testWithResolvedParameter(TestInfo testInfo) {
48+
void testWithResolvedParameter(TestInfo testInfo,
49+
@ExtendWith(ExtensionContextParameterResolver.class) ExtensionContext extensionContext) {
4950
assertNotNull(testInfo);
51+
assertEquals(testInfo.getTestMethod().orElseThrow(), extensionContext.getRequiredTestMethod());
5052
testInvocations++;
5153
}
5254

@@ -57,14 +59,15 @@ static class ExecuteConstructorTwiceTestCase {
5759

5860
static int constructorInvocations = 0;
5961

60-
public ExecuteConstructorTwiceTestCase(TestInfo testInfo) {
62+
public ExecuteConstructorTwiceTestCase(TestInfo testInfo,
63+
@ExtendWith(ExtensionContextParameterResolver.class) ExtensionContext extensionContext) {
6164
assertNotNull(testInfo);
65+
assertEquals(testInfo.getTestClass().orElseThrow(), extensionContext.getRequiredTestClass());
6266
constructorInvocations++;
6367
}
6468

6569
@Test
6670
void test() {
67-
6871
}
6972

7073
}
@@ -84,9 +87,24 @@ static class ExecuteConstructorTwiceExtension implements BeforeAllCallback {
8487
@Override
8588
public void beforeAll(ExtensionContext context) throws Exception {
8689
context.getExecutableInvoker() //
87-
.invoke(context.getRequiredTestClass().getConstructor(TestInfo.class));
90+
.invoke(context.getRequiredTestClass().getConstructor(TestInfo.class, ExtensionContext.class));
8891
}
8992

9093
}
9194

95+
static class ExtensionContextParameterResolver implements ParameterResolver {
96+
97+
@Override
98+
public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
99+
throws ParameterResolutionException {
100+
return ExtensionContext.class.equals(parameterContext.getParameter().getType());
101+
}
102+
103+
@Override
104+
public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
105+
throws ParameterResolutionException {
106+
return extensionContext;
107+
}
108+
}
109+
92110
}

junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/ExtensionContextTests.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void fromJupiterEngineDescriptor() {
7474
UniqueId.root("engine", "junit-jupiter"), configuration);
7575

7676
JupiterEngineExtensionContext engineContext = new JupiterEngineExtensionContext(null, engineTestDescriptor,
77-
configuration, null);
77+
configuration, __ -> null);
7878

7979
// @formatter:off
8080
assertAll("engineContext",
@@ -100,7 +100,7 @@ void fromClassTestDescriptor() {
100100
ClassTestDescriptor outerClassDescriptor = outerClassDescriptor(nestedClassDescriptor);
101101

102102
ClassExtensionContext outerExtensionContext = new ClassExtensionContext(null, null, outerClassDescriptor,
103-
configuration, null, null);
103+
configuration, null, __ -> null);
104104

105105
// @formatter:off
106106
assertAll("outerContext",
@@ -118,7 +118,7 @@ void fromClassTestDescriptor() {
118118
// @formatter:on
119119

120120
ClassExtensionContext nestedExtensionContext = new ClassExtensionContext(outerExtensionContext, null,
121-
nestedClassDescriptor, configuration, null, null);
121+
nestedClassDescriptor, configuration, null, __ -> null);
122122
assertThat(nestedExtensionContext.getParent()).containsSame(outerExtensionContext);
123123
}
124124

@@ -131,18 +131,18 @@ void tagsCanBeRetrievedInExtensionContext() {
131131
outerClassDescriptor.addChild(methodTestDescriptor);
132132

133133
ClassExtensionContext outerExtensionContext = new ClassExtensionContext(null, null, outerClassDescriptor,
134-
configuration, null, null);
134+
configuration, null, __ -> null);
135135

136136
assertThat(outerExtensionContext.getTags()).containsExactly("outer-tag");
137137
assertThat(outerExtensionContext.getRoot()).isSameAs(outerExtensionContext);
138138

139139
ClassExtensionContext nestedExtensionContext = new ClassExtensionContext(outerExtensionContext, null,
140-
nestedClassDescriptor, configuration, null, null);
140+
nestedClassDescriptor, configuration, null, __ -> null);
141141
assertThat(nestedExtensionContext.getTags()).containsExactlyInAnyOrder("outer-tag", "nested-tag");
142142
assertThat(nestedExtensionContext.getRoot()).isSameAs(outerExtensionContext);
143143

144144
MethodExtensionContext methodExtensionContext = new MethodExtensionContext(outerExtensionContext, null,
145-
methodTestDescriptor, configuration, new OpenTest4JAwareThrowableCollector(), null);
145+
methodTestDescriptor, configuration, new OpenTest4JAwareThrowableCollector(), __ -> null);
146146
methodExtensionContext.setTestInstances(DefaultTestInstances.of(new OuterClass()));
147147
assertThat(methodExtensionContext.getTags()).containsExactlyInAnyOrder("outer-tag", "method-tag");
148148
assertThat(methodExtensionContext.getRoot()).isSameAs(outerExtensionContext);
@@ -161,11 +161,11 @@ void fromMethodTestDescriptor() {
161161
Method testMethod = methodTestDescriptor.getTestMethod();
162162

163163
JupiterEngineExtensionContext engineExtensionContext = new JupiterEngineExtensionContext(null, engineDescriptor,
164-
configuration, null);
164+
configuration, __ -> null);
165165
ClassExtensionContext classExtensionContext = new ClassExtensionContext(engineExtensionContext, null,
166-
classTestDescriptor, configuration, null, null);
166+
classTestDescriptor, configuration, null, __ -> null);
167167
MethodExtensionContext methodExtensionContext = new MethodExtensionContext(classExtensionContext, null,
168-
methodTestDescriptor, configuration, new OpenTest4JAwareThrowableCollector(), null);
168+
methodTestDescriptor, configuration, new OpenTest4JAwareThrowableCollector(), __ -> null);
169169
methodExtensionContext.setTestInstances(DefaultTestInstances.of(testInstance));
170170

171171
// @formatter:off
@@ -191,7 +191,7 @@ void reportEntriesArePublishedToExecutionContext() {
191191
ClassTestDescriptor classTestDescriptor = outerClassDescriptor(null);
192192
EngineExecutionListener engineExecutionListener = Mockito.spy(EngineExecutionListener.class);
193193
ExtensionContext extensionContext = new ClassExtensionContext(null, engineExecutionListener,
194-
classTestDescriptor, configuration, null, null);
194+
classTestDescriptor, configuration, null, __ -> null);
195195

196196
Map<String, String> map1 = Collections.singletonMap("key", "value");
197197
Map<String, String> map2 = Collections.singletonMap("other key", "other value");
@@ -222,9 +222,9 @@ void usingStore() {
222222
TestMethodTestDescriptor methodTestDescriptor = methodDescriptor();
223223
ClassTestDescriptor classTestDescriptor = outerClassDescriptor(methodTestDescriptor);
224224
ExtensionContext parentContext = new ClassExtensionContext(null, null, classTestDescriptor, configuration, null,
225-
null);
225+
__ -> null);
226226
MethodExtensionContext childContext = new MethodExtensionContext(parentContext, null, methodTestDescriptor,
227-
configuration, new OpenTest4JAwareThrowableCollector(), null);
227+
configuration, new OpenTest4JAwareThrowableCollector(), __ -> null);
228228
childContext.setTestInstances(DefaultTestInstances.of(new OuterClass()));
229229

230230
ExtensionContext.Store childStore = childContext.getStore(Namespace.GLOBAL);
@@ -274,9 +274,9 @@ Stream<DynamicTest> configurationParameter() throws Exception {
274274
configuration);
275275

276276
return Stream.of( //
277-
(ExtensionContext) new JupiterEngineExtensionContext(null, engineDescriptor, echo, null), //
278-
new ClassExtensionContext(null, null, classTestDescriptor, echo, null, null), //
279-
new MethodExtensionContext(null, null, methodTestDescriptor, echo, null, null) //
277+
(ExtensionContext) new JupiterEngineExtensionContext(null, engineDescriptor, echo, __ -> null), //
278+
new ClassExtensionContext(null, null, classTestDescriptor, echo, null, __ -> null), //
279+
new MethodExtensionContext(null, null, methodTestDescriptor, echo, null, __ -> null) //
280280
).map(context -> dynamicTest(context.getClass().getSimpleName(),
281281
() -> assertEquals(expected, context.getConfigurationParameter(key))));
282282
}

0 commit comments

Comments
 (0)