Package io.quarkus.test
Interface TestMethodInvoker
-
public interface TestMethodInvoker
An SPI that allows modules that integrate with@QuarkusTest
or@QuarkusUnitTest
to alter the invocation of the actual test method. Implementations are loaded from the same ClassLoader that loads the actual test method (so NOT the ClassLoader that loads the extension) which results in the extension having to invoke the method with reflection, but otherwise allows the implementation to (mostly) avoid dealing with class-loading.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
handlesMethodParamType(String paramClassName)
Determine whether this method invoker handles a test method parameter on its ownObject
invoke(Object actualTestInstance, Method actualTestMethod, List<Object> actualTestMethodArgs, String testClassName)
Invoked by QuarkusTestExtension when the test method needs to actually be run.default Object
methodParamInstance(String paramClassName)
boolean
supportsMethod(Class<?> originalTestClass, Method originalTestMethod)
Determines whether this SPI should handle the test method.
-
-
-
Method Detail
-
handlesMethodParamType
default boolean handlesMethodParamType(String paramClassName)
Determine whether this method invoker handles a test method parameter on its own
-
supportsMethod
boolean supportsMethod(Class<?> originalTestClass, Method originalTestMethod)
Determines whether this SPI should handle the test method. The class and method are those supplied by JUnit which means they have been loaded from the original ClassLoader that loaded the QuarkusTestExtension and NOT the ClassLoader that loaded this class.
-
invoke
Object invoke(Object actualTestInstance, Method actualTestMethod, List<Object> actualTestMethodArgs, String testClassName) throws Throwable
Invoked by QuarkusTestExtension when the test method needs to actually be run. The parameters being passed have been loaded by QuarkusTestExtension on the proper ClassLoader- Throws:
Throwable
-
-