Class RepeatedTestExtension
java.lang.Object
org.junit.jupiter.engine.extension.RepeatedTestExtension
- All Implemented Interfaces:
Extension,TestTemplateInvocationContextProvider
TestTemplateInvocationContextProvider that supports the
@RepeatedTest annotation.- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate RepeatedTestDisplayNameFormatterdisplayNameFormatter(RepeatedTest repeatedTest, Method method, String displayName) Provide invocation contexts for the test template method represented by the suppliedcontext.booleansupportsTestTemplate(ExtensionContext context) Determine if this provider supports providing invocation contexts for the test template method represented by the suppliedcontext.private inttotalRepetitions(RepeatedTest repeatedTest, Method method)
-
Constructor Details
-
RepeatedTestExtension
RepeatedTestExtension()
-
-
Method Details
-
supportsTestTemplate
Description copied from interface:TestTemplateInvocationContextProviderDetermine if this provider supports providing invocation contexts for the test template method represented by the suppliedcontext.- Specified by:
supportsTestTemplatein interfaceTestTemplateInvocationContextProvider- Parameters:
context- the extension context for the test template method about to be invoked; nevernull- Returns:
trueif this provider can provide invocation contexts- See Also:
-
provideTestTemplateInvocationContexts
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context) Description copied from interface:TestTemplateInvocationContextProviderProvide invocation contexts for the test template method represented by the suppliedcontext.This method is only called by the framework if
TestTemplateInvocationContextProvider.supportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext)previously returnedtruefor the sameExtensionContext; this method is allowed to return an emptyStreambut notnull.The returned
Streamwill be properly closed by callingBaseStream.close(), making it safe to use a resource such asFiles.lines().- Specified by:
provideTestTemplateInvocationContextsin interfaceTestTemplateInvocationContextProvider- Parameters:
context- the extension context for the test template method about to be invoked; nevernull- Returns:
- a
StreamofTestTemplateInvocationContextinstances for the invocation of the test template method; nevernull - See Also:
-
totalRepetitions
-
displayNameFormatter
private RepeatedTestDisplayNameFormatter displayNameFormatter(RepeatedTest repeatedTest, Method method, String displayName)
-