Class DBIntegrationSpec

All Implemented Interfaces:
JSpecSupport

public class DBIntegrationSpec extends IntegrationSpec
Use this as a super class for integration tests that requires a DB connection to the test DB.
Author:
Igor Polevoy
  • Constructor Details

    • DBIntegrationSpec

      public DBIntegrationSpec()
  • Method Details

    • setRollback

      public void setRollback(boolean rollback)
      Set to true in order to rollback a transaction at the end of the test (default is true). This method will set the autocommit = !rollback on all connections found on this thread.

      WARNING: if you set this value to false inside your test, the framework will not clean any remaining data you insert into your test database. Basically, this is a "manual mode" where you are responsible for cleaning after yourself.

      Parameters:
      rollback - true to rollback transactions at the end of the test, false to not rollback.
    • rollback

      public boolean rollback()
      Current state of 'rollback' flag.
      Returns:
      Current state of 'rollback' flag.
    • initDBConfig

      @BeforeAll public static void initDBConfig()
    • openTestConnections

      @BeforeEach public final void openTestConnections()
    • closeTestConnections

      @AfterEach public void closeTestConnections()
    • clearConnectionConfigs

      @AfterAll public static void clearConnectionConfigs()