Skip to content

Commit 2c2b2a8

Browse files
committed
Document test instance semantics for TestInstancePostProcessors
Issue: #419
1 parent 75fb725 commit 2c2b2a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePostProcessor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,20 @@
2525
* <p>Implementations must provide a no-args constructor.
2626
*
2727
* @since 5.0
28+
* @see #postProcessTestInstance(Object, ExtensionContext)
2829
*/
2930
@API(Experimental)
3031
public interface TestInstancePostProcessor extends Extension {
3132

3233
/**
3334
* Callback for post-processing the supplied test instance.
3435
*
36+
* <p><strong>Note</strong>: the {@code ExtensionContext} supplied to a
37+
* {@code TestInstancePostProcessor} will always return an empty
38+
* {@link java.util.Optional} value from {@link ExtensionContext#getTestInstance()
39+
* getTestInstance()}. A {@code TestInstancePostProcessor} should therefore
40+
* only attempt to process the supplied {@code testInstance}.
41+
*
3542
* @param testInstance the instance to post-process; never {@code null}
3643
* @param context the current extension context; never {@code null}
3744
*/

0 commit comments

Comments
 (0)