Class ConnectorOutputTest.TestSpecification

java.lang.Object
io.debezium.embedded.ConnectorOutputTest.TestSpecification
Enclosing class:
ConnectorOutputTest

public static class ConnectorOutputTest.TestSpecification extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • builtInVariables

      private AvailableVariables builtInVariables()
    • name

      public String name()
      Get the name of this test.
      Returns:
      the name of the test; never null
    • config

      public Configuration config()
      Get the connector's configuration as would normally be passed to Kafka Connect when deploying the connector.
      Returns:
      the configuration; never null
    • environment

      public Configuration environment()
      Get the configuration of the test environment. Often no custom environment configuration properties are required, but they can be used to supply configuration properties to the EmbeddedEngine and the JsonConverter, JsonSerializer and JsonDeserializer instances used to read and write the expected records, as well as the following:
      Returns:
      the test environment configuration; never null
    • testData

      public ConnectorOutputTest.TestData testData()
      Get the data for this test. This method will be called once per execution.
      Returns:
      the test data; never null
    • variables

      public AvailableVariables variables()
      Get the system, environmental, and other variables.
      Returns:
      the variables; never null
    • withName

      Create a new test specification that is a copy of this specification except with the given name.
      Parameters:
      name - the new name
      Returns:
      the new test specification; never null
    • withConfiguration

      public ConnectorOutputTest.TestSpecification withConfiguration(Configuration config)
      Create a new test specification that is a copy of this specification except with the given configuration.
      Parameters:
      config - the new configuration
      Returns:
      the new test specification; never null
    • withConfiguration

      public ConnectorOutputTest.TestSpecification withConfiguration(File file)
      Create a new test specification that is a copy of this specification except with the given configuration.
      Parameters:
      file - the configuration file; may not be null
      Returns:
      the new test specification; never null
    • withConfiguration

      public ConnectorOutputTest.TestSpecification withConfiguration(InputStream stream)
      Create a new test specification that is a copy of this specification except with the given configuration.
      Parameters:
      stream - the input stream to the configuration file; may not be null
      Returns:
      the new test specification; never null
    • withEnvironment

      Create a new test specification that is a copy of this specification except with the given environment.
      Parameters:
      env - the new environment
      Returns:
      the new test specification; never null
    • withEnvironment

      public ConnectorOutputTest.TestSpecification withEnvironment(File file)
      Create a new test specification that is a copy of this specification except with the given environment.
      Parameters:
      file - the file containing the test environment; may not be null
      Returns:
      the new test specification; never null
    • withEnvironment

      public ConnectorOutputTest.TestSpecification withEnvironment(InputStream stream)
      Create a new test specification that is a copy of this specification except with the given environment.
      Parameters:
      stream - the input stream to the file containing the test environment; may not be null
      Returns:
      the new test specification; never null
    • withTestData

      Create a new test specification that is a copy of this specification except with the given data.
      Parameters:
      dataSupplier - the function that returns the new data when needed, given the TestSpecification that will own it; may be null if there is no test data
      Returns:
      the new test specification; never null
    • withReadOrWriteTestData

      public ConnectorOutputTest.TestSpecification withReadOrWriteTestData(Path path)
      Create a new test specification that is a copy of this specification except with the test data read from or able to be written to the given file.
      Parameters:
      path - the path to the file where the test data can be read or to which it is to be written; may not be null
      Returns:
      the new test specification; never null
    • withReadOrWriteTestData

      public ConnectorOutputTest.TestSpecification withReadOrWriteTestData(File file)
      Create a new test specification that is a copy of this specification except with the test data read from or able to be written to the given file.
      Parameters:
      file - the file where the test data can be read or to which it is to be written; may not be null
      Returns:
      the new test specification; never null
    • readJsonTestData

      public ConnectorOutputTest.TestSpecification readJsonTestData(Path path)
      Create a new test specification that is a copy of this specification except with the test data read from the specified file.
      Parameters:
      path - the path to the test data; may not be null
      Returns:
      the new test specification; never null
    • readJsonTestData

      public ConnectorOutputTest.TestSpecification readJsonTestData(File file)
      Create a new test specification that is a copy of this specification except with the test data read from the specified file.
      Parameters:
      file - the test data; may not be null
      Returns:
      the new test specification; never null
    • readJsonTestData

      Create a new test specification that is a copy of this specification except with the test data read from the specified input stream. The supplied stream is read and variables substituted when the test data is read.
      Parameters:
      stream - the supplier to the stream of test data; may not be null
      Returns:
      the new test specification; never null
    • writeJsonTestData

      public ConnectorOutputTest.TestSpecification writeJsonTestData(Path path)
      Create a new test specification that is a copy of this specification except with a ConnectorOutputTest.TestData that can capture the connector output as expected records.
      Parameters:
      path - the path to the file to which the test data is to be written; may not be null
      Returns:
      the new test specification; never null
    • writeJsonTestData

      public ConnectorOutputTest.TestSpecification writeJsonTestData(File file)
      Create a new test specification that is a copy of this specification except with a ConnectorOutputTest.TestData that can capture the connector output as expected records.
      Parameters:
      file - the file to which the test data is to be written; may not be null
      Returns:
      the new test specification; never null
    • writeJsonTestData

      Create a new test specification that is a copy of this specification except with a ConnectorOutputTest.TestData that can capture the connector output as expected records.
      Parameters:
      stream - the stream to which the test data is to be written; may not be null
      Returns:
      the new test specification; never null
    • withVariables

      Create a new test specification that is a copy of this specification except with the given variables.
      Parameters:
      variables - the new variables that should replace this specification's variables
      Returns:
      the new test specification; never null
    • withVariables

      Create a new test specification that is a copy of this specification except with the given variables.
      Parameters:
      variableSupplier - the function used to obtain the variables using the configuration
      Returns:
      the new test specification; never null