@API(value=Internal) public class MethodTestDescriptor extends JupiterTestDescriptor
TestDescriptor for tests based on Java methods.
The default display name for a test method is the name of the method
concatenated with a comma-separated list of parameter types in parentheses.
The names of parameter types are retrieved using Class.getSimpleName().
For example, the default display name for the following test method is
testUser(TestInfo, User).
@Test
void testUser(TestInfo testInfo, @Mock User user) { ... }
Node.SkipResultTestDescriptor.Visitor| Constructor and Description |
|---|
MethodTestDescriptor(UniqueId uniqueId,
java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod) |
| Modifier and Type | Method and Description |
|---|---|
JupiterEngineExecutionContext |
execute(JupiterEngineExecutionContext context)
Execute the behavior of this node.
|
protected static java.lang.String |
generateDefaultDisplayName(java.lang.reflect.Method testMethod) |
java.util.Set<TestTag> |
getTags()
Get the set of tags associated with this descriptor.
|
java.lang.Class<?> |
getTestClass() |
java.lang.reflect.Method |
getTestMethod() |
protected void |
invokeTestMethod(JupiterEngineExecutionContext context) |
boolean |
isContainer()
Determine if this descriptor describes a container.
|
boolean |
isTest()
Determine if this descriptor describes a test.
|
JupiterEngineExecutionContext |
prepare(JupiterEngineExecutionContext context)
Prepare the supplied
context prior to execution. |
Node.SkipResult |
shouldBeSkipped(JupiterEngineExecutionContext context)
Determine if the execution of the supplied
context should be
skipped. |
determineDisplayName, executeAndMaskThrowable, getTags, isLeaf, populateNewExtensionRegistryFromExtendWithaddChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, removeChild, removeFromHierarchy, setParent, setSource, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaccept, getAllDescendants, hasTests, isRootpublic MethodTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)
public final java.util.Set<TestTag> getTags()
TestDescriptorgetTags in interface TestDescriptorgetTags in class AbstractTestDescriptornull
but potentially emptyTestTagpublic final java.lang.Class<?> getTestClass()
public final java.lang.reflect.Method getTestMethod()
public boolean isTest()
TestDescriptorpublic boolean isContainer()
TestDescriptorprotected static java.lang.String generateDefaultDisplayName(java.lang.reflect.Method testMethod)
public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws java.lang.Exception
Nodecontext prior to execution.
The default implementation returns the supplied context unmodified.
java.lang.Exceptionpublic Node.SkipResult shouldBeSkipped(JupiterEngineExecutionContext context) throws java.lang.Exception
Nodecontext should be
skipped.
The default implementation returns Node.SkipResult.doNotSkip().
java.lang.Exceptionpublic JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context) throws java.lang.Exception
NodeContainers typically do not implement this method since the
HierarchicalTestEngine handles execution of their children.
context - the context to execute injava.lang.ExceptionNode.before(C),
Node.after(C)protected void invokeTestMethod(JupiterEngineExecutionContext context)