Class SourcePipelineInvocationContextProvider

java.lang.Object
io.debezium.connector.jdbc.junit.jupiter.e2e.source.SourcePipelineInvocationContextProvider
All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider

public class SourcePipelineInvocationContextProvider extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider
The JDBC sink end to end pipeline context provider. This extension is responsible for creating the Source object and starting the Kafka environment as well as the source databases needed for the test matrix. In addition, it is also responsible for creating the permutations of the test template method invocations.
Author:
Chris Cranford
  • Field Details

  • Constructor Details

    • SourcePipelineInvocationContextProvider

      public SourcePipelineInvocationContextProvider()
  • Method Details

    • 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
    • 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
    • isSkipped

      private boolean isSkipped(SkipWhenSource skipWhenSource, SkipWhenSources skipWhenSources, SourceType sourceType)
    • getExtractNewRecordStateValues

      private List<Boolean> getExtractNewRecordStateValues(Method method)
    • getPropagateColumnTypeValues

      private List<Boolean> getPropagateColumnTypeValues(Method method)
    • getTemporalPrecisionModes

      private List<io.debezium.jdbc.TemporalPrecisionMode> getTemporalPrecisionModes(Method method, SourceType sourceType)
    • isAnyAnnotationPresent

      @SafeVarargs private boolean isAnyAnnotationPresent(AnnotatedElement element, Class<? extends Annotation>... annotations)
    • createInvocationContext

      private org.junit.jupiter.api.extension.TestTemplateInvocationContext createInvocationContext(SourceType sourceType, boolean flatten, boolean propagateTypes, io.debezium.jdbc.TemporalPrecisionMode temporalPrecisionMode, String postgresExtension)
    • getKafkaContainer

      private org.testcontainers.containers.KafkaContainer getKafkaContainer()
    • getKafkaConnectContainer

      private io.debezium.testing.testcontainers.DebeziumContainer getKafkaConnectContainer(org.testcontainers.containers.KafkaContainer kafkaContainer)
    • getSourceContainers

      private Map<SourceType,org.testcontainers.containers.JdbcDatabaseContainer<?>> getSourceContainers()
    • getSourcesToStart

      private List<SourceType> getSourcesToStart()
      Returns the source connectors to start. If the source.connectors environment property is not set, the pipeline defaults to using a specific set of connectors; otherwise the pipeline will only run those specified via the environment variable.