Class HBaseParameterizedTemplateProvider

java.lang.Object
org.apache.hadoop.hbase.HBaseParameterizedTemplateProvider
All Implemented Interfaces:
org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider

@Private public class HBaseParameterizedTemplateProvider extends Object implements org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider
The entry point class for supporting JUnit4 like Parameterized test, where we can use constructor to pass parameters.

JUnit5's ParameterizedClass will create separated test classes, which is different with JUnit4 and ParameterizedTest does not support passing parameters through constructors.

When you want to use this provider, annotation the test class with HBaseParameterizedTestTemplate, and provide a static method named "parameters" for providing the arguments. The method must have no parameter, and return a Stream<Arguments>. All the test method should be marked with TestTemplate, not Test or ParameterizedTest.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • supportsTestTemplate

      public boolean supportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      supportsTestTemplate in interface org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider
    • provideTestTemplateInvocationContexts

      public Stream<org.junit.jupiter.api.extension.TestTemplateInvocationContext> provideTestTemplateInvocationContexts(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      provideTestTemplateInvocationContexts in interface org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider