@@ -389,23 +389,36 @@ private JavaArchive getArchiveProducerOrDefault() {
389389 @ Override
390390 public void interceptBeforeAllMethod (Invocation <Void > invocation , ReflectiveInvocationContext <Method > invocationContext ,
391391 ExtensionContext extensionContext ) throws Throwable {
392- runExtensionMethod (invocationContext , extensionContext , false );
393- invocation .skip ();
392+ if (assertException == null ) {
393+ runExtensionMethod (invocationContext , extensionContext , false );
394+ invocation .skip ();
395+ } else {
396+ invocation .proceed ();
397+ }
394398 }
395399
396400 @ Override
397401 public void interceptBeforeEachMethod (Invocation <Void > invocation , ReflectiveInvocationContext <Method > invocationContext ,
398402 ExtensionContext extensionContext ) throws Throwable {
399- runExtensionMethod (invocationContext , extensionContext , true );
400- invocation .skip ();
403+ if (assertException == null ) {
404+ runExtensionMethod (invocationContext , extensionContext , true );
405+ invocation .skip ();
406+ } else {
407+ invocation .proceed ();
408+ }
401409 }
402410
403411 @ Override
404412 public <T > T interceptTestFactoryMethod (Invocation <T > invocation ,
405413 ReflectiveInvocationContext <Method > invocationContext , ExtensionContext extensionContext ) throws Throwable {
406- T result = (T ) runExtensionMethod (invocationContext , extensionContext , false );
407- invocation .skip ();
408- return result ;
414+ if (assertException == null ) {
415+ @ SuppressWarnings ("unchecked" )
416+ T result = (T ) runExtensionMethod (invocationContext , extensionContext , false );
417+ invocation .skip ();
418+ return result ;
419+ } else {
420+ return invocation .proceed ();
421+ }
409422 }
410423
411424 @ Override
0 commit comments