Class MySqlTestConnection

java.lang.Object
io.debezium.jdbc.JdbcConnection
io.debezium.connector.mysql.MySqlTestConnection
All Implemented Interfaces:
AutoCloseable

public class MySqlTestConnection extends JdbcConnection
A utility for integration test cases to connect the MySQL server running in the Docker container created by this module's build.
Author:
Randall Hauch
  • Field Details

  • Constructor Details

    • MySqlTestConnection

      public MySqlTestConnection(JdbcConfiguration config)
      Create a new instance with the given configuration and connection factory.
      Parameters:
      config - the configuration; may not be null
  • Method Details

    • forTestDatabase

      public static MySqlTestConnection forTestDatabase(String databaseName)
      Obtain a connection instance to the named test database.
      Parameters:
      databaseName - the name of the test database
      Returns:
      the MySQLConnection instance; never null
    • forTestDatabase

      public static MySqlTestConnection forTestDatabase(String databaseName, Map<String,Object> urlProperties)
      Obtain a connection instance to the named test database.
      Parameters:
      databaseName - the name of the test database
      urlProperties - url properties
      Returns:
      the MySQLConnection instance; never null
    • forTestDatabase

      public static MySqlTestConnection forTestDatabase(String databaseName, String username, String password)
      Obtain a connection instance to the named test database.
      Parameters:
      databaseName - the name of the test database
      username - the username
      password - the password
      Returns:
      the MySQLConnection instance; never null
    • isMySQL5

      public static boolean isMySQL5()
      Obtain whether the database source is MySQL 5.x or not.
      Returns:
      true if the database version is 5.x; otherwise false.
    • isPerconaServer

      public static boolean isPerconaServer()
      Obtain whether the database source is the Percona Server fork.
      Returns:
      true if the database is Percona Server; otherwise false.
    • addDefaultSettings

      private static JdbcConfiguration addDefaultSettings(JdbcConfiguration configuration)
    • getMySqlVersion

      public MySqlTestConnection.MySqlVersion getMySqlVersion()
    • getMySqlVersionString

      public String getMySqlVersionString()
    • getMySqlVersionComment

      public String getMySqlVersionComment()
    • isTableIdCaseSensitive

      public boolean isTableIdCaseSensitive()
    • databaseAsserts

      public DatabaseDifferences databaseAsserts()