Is there a way to identify currently running test method (or that the code is not running as part of a test method) in JUnit 5 using a static method (i.e. no matter from where it’s called)?.
I’m not looking for stuff like injecting TestInfo
or ExtensionContext.getTestMethod()
. I’d like something that doesn’t required any changes in the test class code, like a static method.