V
- The class of a assertion on a value (an sub-class of ValueAssert
).public interface ToValueFromRow<V extends ValueAssert>
Row
.
The different methods return an assertion on one value ValueAssert
.
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 ValueAssert
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().returnToOrigin().value("name")......; // Use the returnToOrigin() method of AbstractAssertWithOrigin
// to return on the table or request and access to the value called "name"
assertThat(table_or_request).row().value().value("name")......; // Same as precedent but returnToOrigin() 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 returnToOrigin() method of AbstractAssertWithOrigin
assertThat(table_or_request).row().value().returnToOrigin().returnToOrigin().row().value("name")......;
As shown in the diagram below, if navigating from changes, it is possible to call the method to navigate to a ValueAssert
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 returnToOrigin() method of AbstractAssertWithOrigin to return on the row and access to the value called "name"
assertThat(changes).change().row().value().returnToOrigin().value("name")......;
assertThat(changes).change().row().value().value("name")......; // Same as precedent but returnToOrigin() 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 returnToOrigin() method of AbstractAssertWithOrigin
assertThat(changes).change().row().value().returnToOrigin().returnToOrigin().returnToOrigin().change(0).row().value("name")......;
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 © 2015 AssertJ. All Rights Reserved.