Interface SQLTestHelper


public interface SQLTestHelper
  • Method Summary

    Modifier and Type
    Method
    Description
    default <X> void
    assertJooqException(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<X> ar, org.jooq.exception.SQLStateClass stateClass)
    Assert async result is completed with error then compare exception
    default <X> void
    assertJooqException(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<X> ar, org.jooq.exception.SQLStateClass stateClass, String errorMsg)
    Assert async result is completed with error then compare exception
    default <X> void
    assertJooqException(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<X> ar, org.jooq.exception.SQLStateClass stateClass, String errorMsg, Class<? extends Throwable> causeType)
    Assert async result is completed with error then compare exception
    default void
    assertJooqException(org.jooq.exception.SQLStateClass stateClass, boolean failed, Throwable cause)
    Internal compare.
    default <R> List<R>
    assertResultSize(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<List<R>> asyncResult, int expected)
    Assert async result is completed successful then compare result size
    default <T> T
    assertSuccess(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<T> asyncResult)
    Assert async result is completed successful
    static String
    getCurrentDBVersion(String defaultVersion)
    Get current database version by system property "dbVersion"
    default void
    prepareDatabase(io.vertx.junit5.VertxTestContext context, JooqSQL<?> jooqSql, SQLConnectionOption connOption, String... files)
    Prepare database schema and test data by plain JDBC connection.
  • Method Details

    • getCurrentDBVersion

      static String getCurrentDBVersion(String defaultVersion)
      Get current database version by system property "dbVersion"
      Returns:
      the current database version
    • prepareDatabase

      default void prepareDatabase(io.vertx.junit5.VertxTestContext context, JooqSQL<?> jooqSql, SQLConnectionOption connOption, String... files)
      Prepare database schema and test data by plain JDBC connection. That use HikariCP
      Parameters:
      context - test context
      jooqSql - jooqSQL
      connOption - database connection option
      files - resource SQL files
    • assertSuccess

      default <T> T assertSuccess(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<T> asyncResult)
      Assert async result is completed successful
      Type Parameters:
      T - type of output
      Parameters:
      context - test context
      asyncResult - async result
      Returns:
      output
    • assertResultSize

      default <R> List<R> assertResultSize(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<List<R>> asyncResult, int expected)
      Assert async result is completed successful then compare result size
      Type Parameters:
      R - type of output
      Parameters:
      context - test context
      asyncResult - async result
      expected - expected size
      Returns:
      list of output
    • assertJooqException

      default <X> void assertJooqException(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<X> ar, org.jooq.exception.SQLStateClass stateClass)
      Assert async result is completed with error then compare exception
      Type Parameters:
      X - type of result
      Parameters:
      context - test context
      ar - async result
      stateClass - An expectation SQL state class
      See Also:
      • SQLStateClass
    • assertJooqException

      default <X> void assertJooqException(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<X> ar, org.jooq.exception.SQLStateClass stateClass, String errorMsg)
      Assert async result is completed with error then compare exception
      Type Parameters:
      X - type of result
      Parameters:
      context - test context
      ar - async result
      stateClass - An expectation SQL state class
      errorMsg - An expectation error message
    • assertJooqException

      default <X> void assertJooqException(io.vertx.junit5.VertxTestContext context, io.vertx.core.AsyncResult<X> ar, org.jooq.exception.SQLStateClass stateClass, String errorMsg, Class<? extends Throwable> causeType)
      Assert async result is completed with error then compare exception
      Type Parameters:
      X - type of result
      Parameters:
      context - test context
      ar - async result
      stateClass - An expectation SQL state class
      errorMsg - An expectation error message
      causeType - An expectation cause type
    • assertJooqException

      default void assertJooqException(org.jooq.exception.SQLStateClass stateClass, boolean failed, Throwable cause)
      Internal compare. Don't use it directly