V
- The class of a assertion on a value (an sub-class of ValueElement
).public interface ToValueFromRow<V extends ValueElement> extends Navigation
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 :
AbstractRowAssert
)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 :
ChangeRowAssert
)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")......;
Modifier and Type | Method and Description |
---|---|
V |
value(String columnName)
Returns assertion methods on the value corresponding to the column name in parameter.
|
V value(String columnName)
columnName
- The column name.NullPointerException
- If the column name in parameter is null
.AssertJDBException
- If there is no column with this name.AbstractRowAssert.value(String)
,
AbstractRowValueAssert.value(String)
,
ChangeRowAssert.value(String)
,
ChangeRowValueAssert.value(String)
Copyright © 2020 AssertJ. All rights reserved.