0

JUnit 5's InvocationInterceptor.Invocation#skip() method's documentation says:

Explicitly skip this invocation.

I find this a bit unclear.

Suppose the invocation represents a test method. Suppose further there are two interceptors registered. Suppose interceptor #1 calls skip(). Of the following two options, which describes what is documented to happen (I'm not interested in current behavior that happens to be the case as of this writing, which is option 1)?

  1. The test method will not be executed, and interceptor #2 will not be called either. ("this invocation" means the execution of the test method and any interceptor processing that might occur "around" it.)
  2. The test method will not be executed, but interception will continue with interceptor #2, which might end up calling proceed() or otherwise carrying on normally. ("this invocation" means only the execution of the test method, i.e. not also any interceptor processing that might occur "around" it.)
Laird Nelson
  • 15,321
  • 19
  • 73
  • 127

0 Answers0