Skip to content
Discussion options

You must be logged in to vote

I think there's no way around assigning the ThreadLocal on the thread that will invoke the test. I think it might be easier to implement InvocationInterceptor, though, because that would avoid having to do the nesting with the help of the ExtensionContext.Store. Instead, a try-finally block could be used to set and then reset the ThreadLocal. Moreover, this could be extended to not just support interceptTestMethod, but also all kind of lifecycle methods, etc.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@yawkat
Comment options

@yawkat
Comment options

@marcphilipp
Comment options

Answer selected by yawkat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants