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 5Extension
for supporting running of connector testing framework.This extension is responsible for searching test resources annotated by
TestEnv
,TestExternalSystem
andTestContext
, storing them into storage provided by JUnit, and manage lifecycle of these resources.The extension uses
ExtensionContext.Store
for 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 String
EXTERNAL_CONTEXT_FACTORIES_STORE_KEY
static String
EXTERNAL_SYSTEM_STORE_KEY
static String
SUPPORTED_SEMANTIC_STORE_KEY
static String
TEST_ENV_STORE_KEY
static org.junit.jupiter.api.extension.ExtensionContext.Namespace
TEST_RESOURCE_NAMESPACE
-
Constructor Summary
Constructors Constructor Description ConnectorTestingExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeAll(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
-
-