Class ConnectorTestingExtension
- java.lang.Object
-
- org.apache.flink.connector.testframe.junit.extensions.ConnectorTestingExtension
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback,org.junit.jupiter.api.extension.BeforeAllCallback,org.junit.jupiter.api.extension.Extension
@Internal public class ConnectorTestingExtension extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback
A JUnit 5Extensionfor supporting running of connector testing framework.This extension is responsible for searching test resources annotated by
TestEnv,TestExternalSystemandTestContext, storing them into storage provided by JUnit, and manage lifecycle of these resources.The extension uses
ExtensionContext.Storefor handing over test resources toTestCaseInvocationContextProvider, which will inject these resources into test cases as parameters.The order of initialization is promised to be:
- Test environment annotated by
TestEnv, before all test cases in this extension - External system annotated by
TestExternalSystem, before all test cases in this extension - External contexts annotated by
TestContext, before each test case inTestCaseInvocationContextProvider
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXTERNAL_CONTEXT_FACTORIES_STORE_KEYstatic StringEXTERNAL_SYSTEM_STORE_KEYstatic StringSUPPORTED_SEMANTIC_STORE_KEYstatic StringTEST_ENV_STORE_KEYstatic org.junit.jupiter.api.extension.ExtensionContext.NamespaceTEST_RESOURCE_NAMESPACE
-
Constructor Summary
Constructors Constructor Description ConnectorTestingExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterAll(org.junit.jupiter.api.extension.ExtensionContext context)voidbeforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
-
-
-
Field Detail
-
TEST_RESOURCE_NAMESPACE
public static final org.junit.jupiter.api.extension.ExtensionContext.Namespace TEST_RESOURCE_NAMESPACE
-
TEST_ENV_STORE_KEY
public static final String TEST_ENV_STORE_KEY
- See Also:
- Constant Field Values
-
EXTERNAL_SYSTEM_STORE_KEY
public static final String EXTERNAL_SYSTEM_STORE_KEY
- See Also:
- Constant Field Values
-
EXTERNAL_CONTEXT_FACTORIES_STORE_KEY
public static final String EXTERNAL_CONTEXT_FACTORIES_STORE_KEY
- See Also:
- Constant Field Values
-
SUPPORTED_SEMANTIC_STORE_KEY
public static final String SUPPORTED_SEMANTIC_STORE_KEY
- See Also:
- Constant Field Values
-
-