Package org.assertj.db.navigation
Interface ToRow<R extends RowElement>
- Type Parameters:
R- The class of a assertion on a row (an sub-class ofRowElement).
- All Superinterfaces:
Navigation
- All Known Subinterfaces:
OriginWithColumnsAndRows<C,R>
- All Known Implementing Classes:
AbstractAssertWithOriginWithColumnsAndRows,AbstractColumnAssert,AbstractColumnOutputter,AbstractColumnValueAssert,AbstractColumnValueOutputter,AbstractDbAssert,AbstractDbOutputter,AbstractOutputterWithOriginWithColumnsAndRows,AbstractRowAssert,AbstractRowOutputter,AbstractRowValueAssert,AbstractRowValueOutputter,AbstractSubAssert,AbstractSubOutputter,AbstractValueAssert,AbstractValueOutputter,RequestAssert,RequestColumnAssert,RequestColumnOutputter,RequestColumnValueAssert,RequestColumnValueOutputter,RequestOutputter,RequestRowAssert,RequestRowOutputter,RequestRowValueAssert,RequestRowValueOutputter,TableAssert,TableColumnAssert,TableColumnOutputter,TableColumnValueAssert,TableColumnValueOutputter,TableOutputter,TableRowAssert,TableRowOutputter,TableRowValueAssert,TableRowValueOutputter
Defines methods to navigate to a
Row.
The different methods return an assertion on one row RowElement.
These methods exists when navigating (at the beginning assertThat()) from a Table or from a Request.
As shown in the diagram below, it is possible to call the method to navigate to a RowElement from :
- a table (
TableAssert) - a request (
RequestAssert) - a column (
AbstractColumnAssert) - a value of a column (
AbstractColumnValueAssert) - a row (
AbstractRowAssert) - a value of a row (
AbstractRowValueAssert)
It is important to keep in mind that the methods are executed from the point of view of the last instance with assertion methods on a table (TableAssert) or on a request (RequestAssert).
So all the lines of code below are equivalent : they point on the row at index 1 (as usual, the list start at index 0).
assertThat(table_or_request).row(1)......; // Point directly on the row at index 1
assertThat(table).row().returnToTable().row()......; // Use the returnToTable() method to return on the table
// and access to the next/second row of the list
assertThat(request).row().returnToRequest().row()......; // Use the returnToRequest() method to return on the request
// and access to the next/second row of the list
assertThat(table_or_request).row().row()......; // Same as two precedent but returnToTable() or returnToRequest() is implicit
assertThat(table_or_request).row().row(1)......; // The method with the index can be call too
assertThat(table_or_request).row(2).row(0).row(1)......; // Idem
assertThat(table_or_request).row().value().row()......;
assertThat(table_or_request).row().value().row(1)......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(table).row().value().returnToRow().returnToTable().row(1)......;
assertThat(request).row().value().returnToRow().returnToRequest().row(1)......;
- Author:
- Régis Pouiller
-
Method Summary
-
Method Details
-
row
R row()- Returns:
- An object to make assertions on the next
Row. - Throws:
AssertJDBException- If there are no moreRowin the list ofRows.- See Also:
-
row
Returns assertion methods on theRowat theindexin parameter.- Parameters:
index- The index corresponding to theRow.- Returns:
- An object to make assertions on the
Row. - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-