Class TestUtils

java.lang.Object
com.dtsx.astra.sdk.utils.TestUtils

public class TestUtils extends Object
Helper for tetst.
Author:
Cedrick LUNVEN (@clunven)
  • Field Details

  • Method Details

    • waitForDbStatus

      public static void waitForDbStatus(DatabaseClient dbc, DatabaseStatusType status, int timeoutSeconds)
      Wait for db to have proper status.
      Parameters:
      dbc - database client
      status - database status
      timeoutSeconds - timeout
    • waitForSeconds

      public static void waitForSeconds(int seconds)
      Hold execution for X seconds waiting for async APIS.
      Parameters:
      seconds - time to wait
    • createDbAndKeyspaceIfNotExist

      public static String createDbAndKeyspaceIfNotExist(AstraDbClient devopsDbCli, String dbName, String keyspace)
      Initialize databases for tests.
      Parameters:
      devopsDbCli - devops database API.
      dbName - database name
      keyspace - expected keyspace
      Returns:
      the database id
    • terminateDatabaseByName

      public static void terminateDatabaseByName(AstraDbClient devopsDbCli, String dbName)
      Terminate database if needed.
      Parameters:
      devopsDbCli - devops cli
      dbName - database name