Class TestHelper

java.lang.Object
io.debezium.connector.jdbc.junit.TestHelper

public class TestHelper extends Object
Author:
Chris Cranford
  • Constructor Details

    • TestHelper

      private TestHelper()
  • Method Details

    • shouldQueryDatabaseState

      public static boolean shouldQueryDatabaseState()
      Controls whether the source and sink databases should be queried to output their table state
      Returns:
      true to query the database state, false otherwise (the default).
    • isSourceSnapshot

      public static boolean isSourceSnapshot()
      Allows controlling test behavior on whether data originates from snapshot phase or streaming phase of the end to end integration tests.
      Returns:
      true to use snapshot, false otherwise (the default).
    • isDefaultValuesEnabled

      public static boolean isDefaultValuesEnabled()
      Allows controlling test behavior on whether default values should be included on the source definition side of integration end to end tests.
      Returns:
      true to use default values, false otherwise (the default).
    • isConnectionTimeZoneUsed

      public static boolean isConnectionTimeZoneUsed()
      Allows controlling test behavior on whether to manipulate connection timezone details for databases such as MySQL where the use of connectionTimeZone has implications on how the value is returned via JDBC.
      Returns:
      true if the connection time zone should be applied, otherwise use default driver behavior.
    • getSourceTimeZone

      public static String getSourceTimeZone()
    • getSinkTimeZone

      public static String getSinkTimeZone()
    • assertTable

      public static org.assertj.db.api.TableAssert assertTable(DataSource dataSource, String tableName)
    • assertTable

      public static org.assertj.db.api.TableAssert assertTable(DataSource dataSource, String tableName, String[] columnsToCheck, String[] columnsToExclude)
    • assertTable

      public static org.assertj.db.api.TableAssert assertTable(org.assertj.db.type.Source source, String tableName)
    • getRootCause

      public static Throwable getRootCause(Throwable t)
      Get the nested root-cause of the exception.
      Parameters:
      t - the exception, should not be null
      Returns:
      the nested root-cause exception
    • getPrimaryKeyColumnNames

      public static List<String> getPrimaryKeyColumnNames(DataSource dataSource, String tableName)