Interface ToValueFromRow<V extends ValueElement>
- Type Parameters:
V- The class of a assertion on a value (an sub-class ofValueElement).
- All Superinterfaces:
Navigation
- All Known Subinterfaces:
OriginWithValuesFromRow<CHS,CH, C, R, V>
- All Known Implementing Classes:
AbstractRowAssert,AbstractRowOutputter,AbstractRowValueAssert,AbstractRowValueOutputter,ChangeRowAssert,ChangeRowOutputter,ChangeRowValueAssert,ChangeRowValueOutputter,RequestRowAssert,RequestRowOutputter,RequestRowValueAssert,RequestRowValueOutputter,TableRowAssert,TableRowOutputter,TableRowValueAssert,TableRowValueOutputter
Row.
The different methods return an assertion on one value ValueElement.
These methods exists when navigating (at the beginning assertThat()) from changes, from a Table or from a Request.
As shown in the diagram below, if navigating from table or request, it is possible to call the method to navigate to a ValueElement from :
- a row (
AbstractRowAssert) - a value of a row (
AbstractRowValueAssert)
If navigating from table or request, 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 row (AbstractRowAssert).
So all the lines of code below are equivalent : they point on the value called "name" of first column.
assertThat(table_or_request).row().value("name")......; // Point directly on the value called "name"
assertThat(table_or_request).row().value().returnToRow().value("name")......; // Use the returnToRow() method
// to return on the row and access to the value called "name"
assertThat(table_or_request).row().value().value("name")......; // Same as precedent but returnToRow() is implicit
assertThat(table_or_request).row().value(2).value(0).value("name")......; // Idem
assertThat(table_or_request).row().value().row().value("name")......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(table).row().value().returnToRow().returnToTable().row().value("name")......;
assertThat(request).row().value().returnToRow().returnToRequest().row().value("name")......;
As shown in the diagram below, if navigating from changes, it is possible to call the method to navigate to a ValueElement from :
- a row of a change (
ChangeRowAssert) - a value of a row of a change (
ChangeRowValueAssert)
If navigating from changes, 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 row of a change (ChangeRowAssert).
So all the lines of code below are equivalent : they point on the value called "name" of first row.
assertThat(changes).change().row().value("name")......; // Point directly on the value called "name"
// Use the returnToRow() method to return on the row and access to the value called "name"
assertThat(changes).change().row().value().returnToRow().value("name")......;
assertThat(changes).change().row().value().value("name")......; // Same as precedent but returnToRow() is implicit
assertThat(changes).change().row().value(2).value(0).value("name")......; // Idem
assertThat(changes).change().row().value().change(0).row().value("name")......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(changes).change().row().value().returnToRow().returnToChange().returnToChanges().change(0).row().value("name")......;
- Author:
- Régis Pouiller
-
Method Summary
-
Method Details
-
value
Returns assertion methods on the value corresponding to the column name in parameter.- Parameters:
columnName- The column name.- Returns:
- An object to make assertions on the value.
- Throws:
NullPointerException- If the column name in parameter isnull.AssertJDBException- If there is no column with this name.- See Also:
-