Package io.debezium.connector.jdbc.junit
Class TestHelper
java.lang.Object
io.debezium.connector.jdbc.junit.TestHelper
- Author:
- Chris Cranford
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.assertj.db.api.TableAssertassertTable(DataSource dataSource, String tableName) static org.assertj.db.api.TableAssertassertTable(DataSource dataSource, String tableName, String[] columnsToCheck, String[] columnsToExclude) static org.assertj.db.api.TableAssertassertTable(org.assertj.db.type.Source source, String tableName) getPrimaryKeyColumnNames(DataSource dataSource, String tableName) static ThrowableGet the nested root-cause of the exception.static Stringstatic Stringstatic booleanAllows controlling test behavior on whether to manipulate connection timezone details for databases such as MySQL where the use ofconnectionTimeZonehas implications on how the value is returned via JDBC.static booleanAllows controlling test behavior on whether default values should be included on the source definition side of integration end to end tests.static booleanAllows controlling test behavior on whether data originates from snapshot phase or streaming phase of the end to end integration tests.static booleanControls whether the source and sink databases should be queried to output their table state
-
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 ofconnectionTimeZonehas 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
-
getSinkTimeZone
-
assertTable
-
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
Get the nested root-cause of the exception.- Parameters:
t- the exception, should not benull- Returns:
- the nested root-cause exception
-
getPrimaryKeyColumnNames
-