Interface ToColumnFromChange<C extends ColumnElement>
- Type Parameters:
C
- The class of a assertion on a column (an sub-class ofColumnElement
).
- All Superinterfaces:
Navigation
- All Known Subinterfaces:
OriginWithColumnsAndRowsFromChange<CHS,
,CH, C, R> OriginWithValuesFromColumn<CHS,
,CH, C, R, V> OriginWithValuesFromRow<CHS,
CH, C, R, V>
- All Known Implementing Classes:
AbstractAssertWithOriginWithColumnsAndRowsFromChange
,AbstractAssertWithValues
,AbstractOutputterWithOriginWithColumnsAndRowsFromChange
,AbstractOutputterWithValues
,ChangeAssert
,ChangeColumnAssert
,ChangeColumnOutputter
,ChangeColumnValueAssert
,ChangeColumnValueOutputter
,ChangeOutputter
,ChangeRowAssert
,ChangeRowOutputter
,ChangeRowValueAssert
,ChangeRowValueOutputter
Column
from a Change
.
The different methods return an assertion on one column ColumnElement
.
These methods exists when navigating (at the beginning assertThat()
) from changes.
The difference with ToColumn
is that ToColumn
allows to navigate in all the columns of a Change
and the methods
of ToColumnFromChange
count only the columns
with a modification between the start point and the end point.
As shown in the diagram below, it is possible to call the method to navigate to a ColumnElement
from :
- a change (
ChangeAssert
) - a column of a change (
ChangeColumnAssert
) - a value of a column of a change (
ChangeColumnValueAssert
) - a row of a change (
ChangeRowAssert
) - a value of a row of a change (
ChangeRowValueAssert
)
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 change (ChangeAssert
).
So all the lines of code below are equivalent : they point on the column at index 1 (as usual, the list start at index 0) among the modified columns.
assertThat(changes).change().columnAmongTheModifiedOnes(1)......; // Point directly on the column at index 1
// Use the returnToChange() method to return on the change and access to the next/second column of the list
assertThat(changes).change().columnAmongTheModifiedOnes().returnToChange().columnAmongTheModifiedOnes()......;
assertThat(changes).change().columnAmongTheModifiedOnes().columnAmongTheModifiedOnes()......; // Same as precedent but returnToChange() is implicit
assertThat(changes).change().column().columnAmongTheModifiedOnes(1)......; // The method with the index can be call too
assertThat(changes).change().columnAmongTheModifiedOnes(2).column(0).columnAmongTheModifiedOnes(1)......; // Idem
assertThat(changes).change().columnAmongTheModifiedOnes().value().columnAmongTheModifiedOnes()......;
assertThat(changes).change().column().value().columnAmongTheModifiedOnes(1)......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(changes).change().columnAmongTheModifiedOnes().value().returnToColumn().returnToChange().columnAmongTheModifiedOnes(1)......;
- Author:
- Régis Pouiller
-
Method Summary
Modifier and TypeMethodDescriptioncolumnAmongTheModifiedOnes
(int index) columnAmongTheModifiedOnes
(String columnName)
-
Method Details
-
columnAmongTheModifiedOnes
C columnAmongTheModifiedOnes()- Returns:
- An object to make assertions on the
Column
. - Throws:
AssertJDBException
- If there are no moreColumn
among the list of modifiedColumn
s.- See Also:
-
columnAmongTheModifiedOnes
- Parameters:
index
- The index corresponding to theColumn
among the list of modifiedColumn
s..- Returns:
- An object to make assertions on the
Column
. - Throws:
AssertJDBException
- If theindex
is out of the bounds.- See Also:
-
columnAmongTheModifiedOnes
Returns assertion methods on theColumn
corresponding to the column name in parameter among the modifiedColumn
s.- Parameters:
columnName
- The column name.- Returns:
- An object to make assertions on the
Column
. - Throws:
NullPointerException
- If the column name in parameter isnull
.AssertJDBException
- If there is no column with this name among the list of modifiedColumn
s.- See Also:
-