ParameterResolver that resolves the TestInfo for
the currently executing test.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| TestInfoParameterResolver | back to summary |
|---|---|
| pack-priv TestInfoParameterResolver() | |
| getTestInstantiationExtensionContextScope | back to summary |
|---|---|
| public TestInstantiationAwareExtension. Overrides default org. Determine whether this extension should receive a test-method scoped
If an extension returns
When a test-method scoped
Note The behavior which is enabled by returning
| |
| resolveParameter | back to summary |
|---|---|
| public TestInfo resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Implements org. Doc from org. Resolve an argument for the This method is only called by the framework if The
| |
| supportsParameter | back to summary |
|---|---|
| public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Implements org. Doc from org. Determine if this resolver supports resolution of an argument for the
The
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final Set | |
| private final Optional | |
| private final Optional |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String | getDisplayName()
Implements org. Get the display name of the current test or container. |
| public Set | getTags()
Implements org. Get the set of all tags for the current test or container. |
| public Optional | getTestClass()
Implements org. Get the |
| public Optional | getTestMethod()
Implements org. Get the |
| private static @Nullable Object | |
| public String |
| displayName | back to summary |
|---|---|
| private final String displayName | |
| tags | back to summary |
|---|---|
| private final Set<String> tags | |
| testClass | back to summary |
|---|---|
| private final Optional<Class<?>> testClass | |
| testMethod | back to summary |
|---|---|
| private final Optional<Method> testMethod | |
| DefaultTestInfo | back to summary |
|---|---|
| pack-priv DefaultTestInfo(ExtensionContext extensionContext) | |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName() Implements org. Doc from org. Get the display name of the current test or container. The display name is either a default name or a custom name configured
via Default Display NamesIf the context in which
class TopLevelTests {
@Nested
class NestedTests {}
static class StaticTests {}
}
If the context in which
@Test
void testUser(TestInfo testInfo, @Mock User user) {}
Note that display names are typically used for test reporting in IDEs and build tools and may contain spaces, special characters, and even emoji.
| |
| getTags | back to summary |
|---|---|
| public Set Implements org. Doc from org. Get the set of all tags for the current test or container. Tags may be declared directly on the test element or inherited from an outer context.
| |
| getTestClass | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Get the
| |
| getTestMethod | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Get the
| |
| nullSafeGet | back to summary |
|---|---|
private static @Nullable Object nullSafeGet(@Nullable Optional<?> optional)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |