Replies: 1 comment
-
Ah, I see now that reading the fine print tells you that it has no Instance. https://github.com/junit-team/junit5/blob/1150d6b389bdcd0c1fcb0def7d5037ec1940d064/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePostProcessor.java#L43-L55 so at least it's documented, but it's still awkward to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was surprised that the ExtensionContext provided to postProcessInstance has neither Method nor Instance in it.
With a lifecycle of PER_METHOD, I expected every instance to have a corresponding method.
Yes, postProcess does receive an
instance
parameter independently of its context,but I am trying to share code with a ParameterResolver.
I fear it will be messy to teach that code that sometimes the ExtensionContext is sufficient
and sometimes it needs AdditionalStuffBeyondContext.
My goal is to have have a resource in ExtensionContext.Store with the same lifespan as
the TestInstance Lifecycle. Sounds like a simple use case but I'm tripping over a lot of ways to do it wrong.
Beta Was this translation helpful? Give feedback.
All reactions