Interface ToValue<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:
AbstractColumnAssert
,AbstractColumnOutputter
,AbstractColumnValueAssert
,AbstractColumnValueOutputter
,AbstractRowAssert
,AbstractRowOutputter
,AbstractRowValueAssert
,AbstractRowValueOutputter
,AbstractSubAssert
,AbstractSubOutputter
,AbstractValueAssert
,AbstractValueOutputter
,ChangeRowAssert
,ChangeRowOutputter
,ChangeRowValueAssert
,ChangeRowValueOutputter
,RequestColumnAssert
,RequestColumnOutputter
,RequestColumnValueAssert
,RequestColumnValueOutputter
,RequestRowAssert
,RequestRowOutputter
,RequestRowValueAssert
,RequestRowValueOutputter
,TableColumnAssert
,TableColumnOutputter
,TableColumnValueAssert
,TableColumnValueOutputter
,TableRowAssert
,TableRowOutputter
,TableRowValueAssert
,TableRowValueOutputter
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 column (
AbstractColumnAssert
) - a value of a column (
AbstractColumnValueAssert
) - 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 column (AbstractColumnAssert
) or on a row (AbstractRowAssert
).
So all the lines of code below are equivalent : they point on the value at index 1 (as usual, the list start at index 0) of first column.
assertThat(table_or_request).column().value(1)......; // Point directly on the value at index 1
assertThat(table_or_request).column().value().returnToColumn().value()......; // Use the returnToColumn() method to return to origin
// to return on the column and access to the next/second value of the list
assertThat(table_or_request).column().value().value()......; // Same as precedent but returnToColumn() is implicit
assertThat(table_or_request).column().value().value(1)......; // The method with the index can be call too
assertThat(table_or_request).column().value(2).value(0).value(1)......; // Idem
assertThat(table_or_request).column().value().column().value(1)......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(table).column().value().returnToColumn().returnToTable().column().value(1)......;
assertThat(request).column().value().returnToColumn().returnToRequest().column().value(1)......;
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 at index 1 (as usual, the list start at index 0) of first row.
assertThat(changes).change().row().value(1)......; // Point directly on the value at index 1
// Use the returnToRow() method return on the row and access to the next/second value of the list
assertThat(changes).change().row().value().returnToRow().value()......;
assertThat(changes).change().row().value().value()......; // Same as precedent but returnToRow() is implicit
assertThat(changes).change().row().value().value(1)......; // The method with the index can be call too
assertThat(changes).change().row().value(2).value(0).value(1)......; // Idem
assertThat(changes).change().row().value().change(0).row().value(1)......;
// 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(1)......;
- Author:
- Régis Pouiller
-
Method Summary
-
Method Details
-
value
V value()Returns assertion methods on the next value in the list of values.- Returns:
- An object to make assertions on the next value.
- Throws:
AssertJDBException
- If there are no more value in the list of values.- See Also:
-
value
Returns assertion methods on the value at theindex
in parameter.- Parameters:
index
- The index corresponding to the value.- Returns:
- An object to make assertions on the value.
- Throws:
AssertJDBException
- If theindex
is out of the bounds.- See Also:
-