Interface SqlGet
- All Known Implementing Classes:
JdbcExecutor,MariaDb,MsSQL,MySQL,OracleDb,PostgreSQL
public interface SqlGet
Defines operations for executing SQL SELECT queries.
Implementations of this interface are responsible for performing read-only database operations that retrieve data without modifying the database state, such as get data for asserts or reports.
This interface should contain only non-mutating operations.
All data-changing SQL commands must be handled by SqlPost.
-
Method Summary
Modifier and TypeMethodDescriptionvoidseeRecordExistsInTable(String tableName, Object[][] conditionsArray) Assert that exists at least one record by conditions with awaitvoidseeRecordExistsInTable(String tableName, String providedJson) Assert that exists at least one record by conditions with awaitvoidseeRecordExistsInTableCustom(String tableName, String conditions) Assert that exists at least one record by conditions with awaitvoidseeRowsCountInTableExactly(String tableName, int expectedCount) Assert of records EXACTLY count with awaitvoidseeRowsCountInTableExactly(String tableName, int expectedCount, int awaitMs) Assert of records EXACTLY count with custom awaitvoidseeRowsCountInTableExactly(String tableName, Object[][] conditionsArray, int expectedCount) Assert of records EXACTLY count by conditions with awaitvoidseeRowsCountInTableExactly(String tableName, Object[][] conditionsArray, int expectedCount, int awaitMs) Assert of records EXACTLY count by conditions with custom awaitvoidseeRowsCountInTableExactly(String tableName, String providedJson, int expectedCount) Assert of records EXACTLY count with awaitvoidseeRowsCountInTableExactlyCustom(String tableName, String conditions, int expectedCount) Assert of records EXACTLY count by conditions with awaitvoidseeRowsCountInTableExactlyCustom(String tableName, String conditions, int expectedCount, int awaitMs) Assert of records EXACTLY count by conditions with custom awaitvoidseeTableDoesNotEmpty(String tableName) Assert That table has no records with awaitvoidseeTableIsEmpty(String tableName) Assert That table has at least one record with awaitvoidshowDataByCondition(String tableName, Object[][] conditionsArray) Method to show full record/records by condition if existsvoidshowDataFromTable(String tableName) Method to create attachment with all rows by all columns in table
-
Method Details
-
seeRowsCountInTableExactly
Assert of records EXACTLY count by conditions with await- Parameters:
tableName- schema_name.table_nameconditionsArray- Object[][] with template {{"column1", "value1"},...}expectedCount- expected rows count- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactlyCustom
Assert of records EXACTLY count by conditions with await- Parameters:
tableName- schema_name.table_nameconditions- String "where id=1"expectedCount- expected rows count- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactly
Assert of records EXACTLY count with await- Parameters:
tableName- schema_name.table_nameexpectedCount- expected rows count- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactly
Assert of records EXACTLY count with awaitUse custom sql conditions only if it`s necessary, otherwise use
seeRowsCountInTableExactly(java.lang.String, java.lang.Object[][], int)- Parameters:
tableName- schema_name.table_nameprovidedJson- String with json """{"column1": "test_value1", ...}"""
support up to 2 options in key after field
"CREATE_DATE:>="
"CREATE_DATE:=:TIMESTAMP" (for oracleDd)expectedCount- expected rows count- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactly
void seeRowsCountInTableExactly(String tableName, Object[][] conditionsArray, int expectedCount, int awaitMs) Assert of records EXACTLY count by conditions with custom await- Parameters:
tableName- schema_name.table_nameconditionsArray- Object[][] with template {{"column1", "value1"},...}expectedCount- expected rows countawaitMs- await in ms- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactlyCustom
void seeRowsCountInTableExactlyCustom(String tableName, String conditions, int expectedCount, int awaitMs) Assert of records EXACTLY count by conditions with custom await- Parameters:
tableName- schema_name.table_nameconditions- String "where id=1"expectedCount- expected rows countawaitMs- await in ms- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactly
Assert of records EXACTLY count with custom await- Parameters:
tableName- schema_name.table_nameexpectedCount- expected rows countawaitMs- await in ms- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeTableIsEmpty
Assert That table has at least one record with await- Parameters:
tableName- schema_name.table_name- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeTableDoesNotEmpty
Assert That table has no records with await- Parameters:
tableName- schema_name.table_name- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRecordExistsInTable
Assert that exists at least one record by conditions with await- Parameters:
tableName- schema_name.table_nameconditionsArray- Object[][] with template {{"column1", "value1"},...}- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRecordExistsInTable
Assert that exists at least one record by conditions with await- Parameters:
tableName- schema_name.table_nameprovidedJson- String with json """{"column1": "test_value1", ...}"""
support up to 2 options in key after field
"CREATE_DATE:>="
"CREATE_DATE:=:TIMESTAMP" (for oracleDd)- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
seeRecordExistsInTableCustom
Assert that exists at least one record by conditions with awaitUse custom sql conditions only if it`s necessary, otherwise use
seeRecordExistsInTable(java.lang.String, java.lang.Object[][])- Parameters:
tableName- schema_name.table_nameconditions- String "where id=1"- Throws:
org.awaitility.core.ConditionTimeoutException- on assert fail (and adds Allure attachments)
-
showDataFromTable
Method to create attachment with all rows by all columns in table- Parameters:
tableName- schema_name.table_name
-
showDataByCondition
Method to show full record/records by condition if exists- Parameters:
tableName- schema_name.table_nameconditionsArray- Object[][] with conditions {{"ID", "1"}, {"NAME", "Alex"}}- Throws:
org.awaitility.core.ConditionTimeoutException- if record/s not found by conditions
-