Package com.dtsx.astra.sdk.utils
Class TestUtils
java.lang.Object
com.dtsx.astra.sdk.utils.TestUtils
Helper for tetst.
- Author:
- Cedrick LUNVEN (@clunven)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Test constant.static final String
Test constant.static final CloudProviderType
Test constant.static final String
Test constant.static final String
Test constant. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
createDbAndKeyspaceIfNotExist
(AstraDbClient devopsDbCli, String dbName, String keyspace) Initialize databases for tests.static void
terminateDatabaseByName
(AstraDbClient devopsDbCli, String dbName) Terminate database if needed.static void
waitForDbStatus
(DatabaseClient dbc, DatabaseStatusType status, int timeoutSeconds) Wait for db to have proper status.static void
waitForSeconds
(int seconds) Hold execution for X seconds waiting for async APIS.
-
Field Details
-
TEST_DBNAME
Test constant.- See Also:
-
TEST_NAMESPACE
Test constant.- See Also:
-
TEST_REGION
Test constant.- See Also:
-
TEST_PROVIDER
Test constant. -
TEST_TIER
Test constant.- See Also:
-
-
Method Details
-
waitForDbStatus
public static void waitForDbStatus(DatabaseClient dbc, DatabaseStatusType status, int timeoutSeconds) Wait for db to have proper status.- Parameters:
dbc
- database clientstatus
- database statustimeoutSeconds
- 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 namekeyspace
- expected keyspace- Returns:
- the database id
-
terminateDatabaseByName
Terminate database if needed.- Parameters:
devopsDbCli
- devops clidbName
- database name
-