Class 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 5 Extension for supporting running of connector testing framework.

    This extension is responsible for searching test resources annotated by TestEnv, TestExternalSystem and TestContext, storing them into storage provided by JUnit, and manage lifecycle of these resources.

    The extension uses ExtensionContext.Store for handing over test resources to TestCaseInvocationContextProvider, which will inject these resources into test cases as parameters.

    The order of initialization is promised to be:

    1. Test environment annotated by TestEnv, before all test cases in this extension
    2. External system annotated by TestExternalSystem, before all test cases in this extension
    3. External contexts annotated by TestContext, before each test case in TestCaseInvocationContextProvider
    • Field Detail

      • TEST_RESOURCE_NAMESPACE

        public static final org.junit.jupiter.api.extension.ExtensionContext.Namespace TEST_RESOURCE_NAMESPACE
      • EXTERNAL_CONTEXT_FACTORIES_STORE_KEY

        public static final String EXTERNAL_CONTEXT_FACTORIES_STORE_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConnectorTestingExtension

        public ConnectorTestingExtension()
    • Method Detail

      • beforeAll

        public void beforeAll​(org.junit.jupiter.api.extension.ExtensionContext context)
                       throws Exception
        Specified by:
        beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
        Throws:
        Exception
      • afterAll

        public void afterAll​(org.junit.jupiter.api.extension.ExtensionContext context)
                      throws Exception
        Specified by:
        afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
        Throws:
        Exception