Interface SqlGet
- All Known Implementing Classes:
CustomDb,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 conditionsvoidseeRecordExistsInTable(String tableName, String providedJson) Assert that exists at least one record by conditionsvoidseeRecordExistsInTableCustom(String tableName, String conditions) Assert that exists at least one record by conditions with awaitvoidseeRowsCountInTableExactly(String tableName, int expectedCount) Assert of records EXACTLY countvoidseeRowsCountInTableExactly(String tableName, Object[][] conditionsArray, int expectedCount) Assert of records EXACTLY count by conditionsvoidseeRowsCountInTableExactly(String tableName, String providedJson, int expectedCount) Assert of records EXACTLY countvoidseeRowsCountInTableExactlyCustom(String tableName, String conditions, int expectedCount) Assert of records EXACTLY count by conditionsvoidseeTableDoesNotEmpty(String tableName) Assert That table has at least one recordvoidseeTableIsEmpty(String tableName) Assert That table has no recordsvoidshowDataByCondition(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 conditionswith await
- Parameters:
tableName- schema_name.table_nameconditionsArray- Object[][] with template {{"column1", "value1"},...}expectedCount- expected rows count- Throws:
AssertionError- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactlyCustom
Assert of records EXACTLY count by conditionswith await
- Parameters:
tableName- schema_name.table_nameconditions- String "where id=1"expectedCount- expected rows count- Throws:
AssertionError- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactly
Assert of records EXACTLY countwith await
- Parameters:
tableName- schema_name.table_nameexpectedCount- expected rows count- Throws:
AssertionError- on assert fail (and adds Allure attachments)
-
seeRowsCountInTableExactly
Assert of records EXACTLY countwith await
Use 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:
AssertionError- on assert fail (and adds Allure attachments)
-
seeTableIsEmpty
Assert That table has no recordswith await
- Parameters:
tableName- schema_name.table_name- Throws:
AssertionError- on assert fail (and adds Allure attachments)
-
seeTableDoesNotEmpty
Assert That table has at least one recordwith await
- Parameters:
tableName- schema_name.table_name- Throws:
AssertionError- on assert fail (and adds Allure attachments)
-
seeRecordExistsInTable
Assert that exists at least one record by conditionswith await
- Parameters:
tableName- schema_name.table_nameconditionsArray- Object[][] with template {{"column1", "value1"},...}- Throws:
AssertionError- on assert fail (and adds Allure attachments)
-
seeRecordExistsInTable
Assert that exists at least one record by conditionswith 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:
AssertionError- 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:
AssertionError- 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:
AssertionError- if record/s not found by conditions
-