class RepeatedTestExtension extends java.lang.Object implements TestTemplateInvocationContextProvider
TestTemplateInvocationContextProvider
that supports the
@RepeatedTest
annotation.Constructor and Description |
---|
RepeatedTestExtension() |
Modifier and Type | Method and Description |
---|---|
private RepeatedTestDisplayNameFormatter |
displayNameFormatter(RepeatedTest repeatedTest,
java.lang.reflect.Method method,
java.lang.String displayName) |
java.util.stream.Stream<TestTemplateInvocationContext> |
provideTestTemplateInvocationContexts(ExtensionContext context)
Provide invocation contexts
for the test template method represented by the supplied
context . |
boolean |
supportsTestTemplate(ExtensionContext context)
Determine if this provider supports providing invocation contexts for the
test template method represented by the supplied
context . |
private int |
totalRepetitions(RepeatedTest repeatedTest,
java.lang.reflect.Method method) |
public boolean supportsTestTemplate(ExtensionContext context)
TestTemplateInvocationContextProvider
context
.supportsTestTemplate
in interface TestTemplateInvocationContextProvider
context
- the extension context for the test template method about
to be invoked; never null
true
if this provider can provide invocation contextsTestTemplateInvocationContextProvider.provideTestTemplateInvocationContexts(org.junit.jupiter.api.extension.ExtensionContext)
,
ExtensionContext
public java.util.stream.Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context)
TestTemplateInvocationContextProvider
context
.
This method is only called by the framework if TestTemplateInvocationContextProvider.supportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext)
previously returned true
for the same ExtensionContext
.
Thus, this method must not return an empty Stream
.
The returned Stream
will be properly closed by calling
BaseStream.close()
, making it safe to use a resource such as
Files.lines()
.
provideTestTemplateInvocationContexts
in interface TestTemplateInvocationContextProvider
context
- the extension context for the test template method about
to be invoked; never null
Stream
of TestTemplateInvocationContext
instances for the invocation of the test template method; never null
or emptyTestTemplateInvocationContextProvider.supportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext)
,
ExtensionContext
private int totalRepetitions(RepeatedTest repeatedTest, java.lang.reflect.Method method)
private RepeatedTestDisplayNameFormatter displayNameFormatter(RepeatedTest repeatedTest, java.lang.reflect.Method method, java.lang.String displayName)