V
- The class of a assertion on a value (an sub-class of ValueAssert
).public interface ToValue<V extends ValueAssert>
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 :
AbstractColumnAssert
)AbstractColumnValueAssert
)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 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().returnToOrigin().value()......; // Use the returnToOrigin() method of AbstractAssertWithOrigin
// to return on the table or request and access to the next/second value of the list
assertThat(table_or_request).column().value().value()......; // Same as precedent but returnToOrigin() 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 returnToOrigin() method of AbstractAssertWithOrigin
assertThat(table_or_request).column().value().returnToOrigin().returnToOrigin().column().value(1)......;
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 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 returnToOrigin() method of AbstractAssertWithOrigin to return on the row and access to the next/second value of the list
assertThat(changes).change().row().value().returnToOrigin().value()......;
assertThat(changes).change().row().value().value()......; // Same as precedent but returnToOrigin() 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 returnToOrigin() method of AbstractAssertWithOrigin
assertThat(changes).change().row().value().returnToOrigin().returnToOrigin().returnToOrigin().change(0).row().value(1)......;
V value()
AssertJDBException
- If there are no more value in the list of values.AbstractSubAssert.value()
,
AbstractValueAssert.value()
,
AbstractSubAssert.value()
,
AbstractValueAssert.value()
,
ChangeRowAssert.value()
,
ChangeRowValueAssert.value()
V value(int index)
index
in parameter.index
- The index corresponding to the value.AssertJDBException
- If the index
is out of the bounds.AbstractSubAssert.value(int)
,
AbstractValueAssert.value(int)
,
AbstractSubAssert.value(int)
,
AbstractValueAssert.value(int)
,
ChangeRowAssert.value(int)
,
ChangeRowValueAssert.value(int)
Copyright © 2015 AssertJ. All Rights Reserved.