Top Description Methods
org.junit.jupiter.api.extension

public Interface TestTemplateInvocationContext

Annotations
@API
status:STABLE
since:5.0
Static Imports
java.util.Collections.emptyList, org.apiguardian.api.API.Status.STABLE

TestTemplateInvocationContext represents the context of a single invocation of a test template.

Each context is provided by a TestTemplateInvocationContextProvider.

Since
5.0
See Also
org.junit.jupiter.api.TestTemplate, TestTemplateInvocationContextProvider

Method Summary

Modifier and TypeMethod and Description
public default List<Extension>

Returns:

the additional extensions for this invocation; never null or containing null elements, but potentially empty
getAdditionalExtensions
()

Get the additional extensions for this invocation.

public default String

Returns:

the display name for this invocation; never null or blank
getDisplayName
(int
the index of this invocation (1-based).
invocationIndex
)

Get the display name for this invocation.

Method Detail

getAdditionalExtensionsback to summary
public default List<Extension> getAdditionalExtensions()

Get the additional extensions for this invocation.

The extensions provided by this method will only be used for this invocation of the test template. Thus, it does not make sense to return an extension that acts solely on the container level (e.g. BeforeAllCallback).

The default implementation returns an empty list.

Returns:List<Extension>

the additional extensions for this invocation; never null or containing null elements, but potentially empty

getDisplayNameback to summary
public default String getDisplayName(int invocationIndex)

Get the display name for this invocation.

The supplied invocationIndex is incremented by the framework with each test invocation. Thus, in the case of multiple active providers, only the first active provider receives indices starting with 1.

The default implementation returns the supplied invocationIndex wrapped in brackets — for example, [1], [42], etc.

Parameters
invocationIndex:int

the index of this invocation (1-based).

Returns:String

the display name for this invocation; never null or blank