Interface ConnectorOutputTest.TestData

All Superinterfaces:
AutoCloseable
Enclosing class:
ConnectorOutputTest
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ConnectorOutputTest.TestData extends AutoCloseable
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    If records are being recorded, then complete writing them and close all resources associated with the test data.
    Read the records that are expected by the test.
    default void
    write(Document sourceRecord)
    Record the function that should be called with each of the actual records output by the connector.
  • Method Details

    • read

      Iterator<Document> read() throws IOException
      Read the records that are expected by the test.
      Returns:
      the expected records, or null if there are none
      Throws:
      IOException - if there is a problem reading the expected records
    • write

      default void write(Document sourceRecord)
      Record the function that should be called with each of the actual records output by the connector. By default this method does nothing.
      Parameters:
      sourceRecord - the JSON representation of the source record; never null
    • close

      default void close() throws IOException
      If records are being recorded, then complete writing them and close all resources associated with the test data. By default this method does nothing.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if there is a problem writing the expected records