Package org.assertj.db.navigation
Interface ToChange<CH extends ChangeElement>
- Type Parameters:
CH- The class of a assertion on a change (an sub-class ofChangeElement).
- All Superinterfaces:
Navigation
- All Known Subinterfaces:
OriginWithChanges<CHS,,CH> OriginWithColumnsAndRowsFromChange<CHS,,CH, C, R> OriginWithValuesFromColumn<CHS,,CH, C, R, V> OriginWithValuesFromRow<CHS,CH, C, R, V>
- All Known Implementing Classes:
AbstractAssertWithOriginWithChanges,AbstractAssertWithOriginWithColumnsAndRowsFromChange,AbstractAssertWithValues,AbstractOutputterWithOriginWithChanges,AbstractOutputterWithOriginWithColumnsAndRowsFromChange,AbstractOutputterWithValues,ChangeAssert,ChangeColumnAssert,ChangeColumnOutputter,ChangeColumnValueAssert,ChangeColumnValueOutputter,ChangeOutputter,ChangeRowAssert,ChangeRowOutputter,ChangeRowValueAssert,ChangeRowValueOutputter,ChangesAssert,ChangesOutputter
Defines methods to navigate to an instance with assertion methods on a
Change.
The different methods return an instance with assertion methods on one change (ChangeAssert).
These methods exists when navigating (at the beginning assertThat()) from changes.
As shown in the diagram below, it is possible to call the method to navigate to a change from :
- changes (
ChangesAssert) - another 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 changes (ChangesAssert).
So all the lines of code below are equivalent : they point on the change at index 1 (as usual, the list start at index 0).
assertThat(changes).change(1)......; // Point directly on the change at index 1
assertThat(changes).change().returnToChange().change()......; // Use the returnToChange() method to return to origin
// to return on the changes and access to the next/second change of the list
assertThat(changes).change().change()......; // Same as precedent but returnToChange() is implicit
assertThat(changes).change().change(1)......; // The method with the index can be call too
assertThat(changes).change(2).change(0).change(1)......; // Idem
assertThat(changes).change().column().change()......;
assertThat(changes).change().rowAtEndPoint().change(1)......;
assertThat(changes).change().column().value().change()......;
assertThat(changes).change().rowAtEndPoint().value().change(1)......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(changes).change().rowAtEndPoint().value().returnToRow().returnToChange().returnToChanges().change(1)......;
- Author:
- Régis Pouiller
-
Method Summary
Modifier and TypeMethodDescriptionchange()Returns assertion methods on the nextChangein the list of changes.change(int index) Returns assertion methods on theChangeat theindexin parameter.Returns assertion methods on the nextChangeof creation (ChangeType.CREATION) in the list of changes.changeOfCreation(int index) Returns assertion methods on theChangeof creation (ChangeType.CREATION) at theindexin parameter.changeOfCreationOnTable(String tableName) Returns assertion methods on the nextChangeof creation (ChangeType.CREATION) on the tabletableNamein the list of changes.changeOfCreationOnTable(String tableName, int index) Returns assertion methods on theChangeof creation (ChangeType.CREATION) on the tabletableNameat theindexin parameter.Returns assertion methods on the nextChangeof deletion (ChangeType.DELETION) in the list of changes.changeOfDeletion(int index) Returns assertion methods on theChangeof deletion (ChangeType.DELETION) at theindexin parameter.changeOfDeletionOnTable(String tableName) Returns assertion methods on the nextChangeof deletion (ChangeType.DELETION) on the tabletableNamein the list of changes.changeOfDeletionOnTable(String tableName, int index) Returns assertion methods on theChangeof deletion (ChangeType.DELETION) on the tabletableNameat theindexin parameter.Returns assertion methods on the nextChangeof modification (ChangeType.MODIFICATION) in the list of changes.changeOfModification(int index) Returns assertion methods on theChangeof modification (ChangeType.MODIFICATION) at theindexin parameter.changeOfModificationOnTable(String tableName) Returns assertion methods on the nextChangeof modification (ChangeType.MODIFICATION) on the tabletableNamein the list of changes.changeOfModificationOnTable(String tableName, int index) Returns assertion methods on theChangeof modification (ChangeType.MODIFICATION) on the tabletableNameat theindexin parameter.changeOnTable(String tableName) Returns assertion methods on the nextChangeon the tabletableNamein the list of changes.changeOnTable(String tableName, int index) changeOnTableWithPks(String tableName, Object... pksValues) Returns assertion methods on theChangeon the tabletableNamecorresponding to the primary key in parameter.
-
Method Details
-
change
CH change()Returns assertion methods on the nextChangein the list of changes.- Returns:
- An object to make assertions on the next
Change. - Throws:
AssertJDBException- If there are no moreChangein the list of changes.- See Also:
-
change
Returns assertion methods on theChangeat theindexin parameter.- Parameters:
index- The index corresponding to theChange.- Returns:
- An object to make assertions on the
Change. - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
changeOfCreation
CH changeOfCreation()Returns assertion methods on the nextChangeof creation (ChangeType.CREATION) in the list of changes.- Returns:
- An object to make assertions on the next
Changeof creation (ChangeType.CREATION). - Throws:
AssertJDBException- If there are no moreChangeof creation (ChangeType.CREATION) in the list of changes.- See Also:
-
changeOfCreation
Returns assertion methods on theChangeof creation (ChangeType.CREATION) at theindexin parameter.- Parameters:
index- The index corresponding to theChangeof creation (ChangeType.CREATION).- Returns:
- An object to make assertions on the
Changeof creation (ChangeType.CREATION). - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
changeOfModification
CH changeOfModification()Returns assertion methods on the nextChangeof modification (ChangeType.MODIFICATION) in the list of changes.- Returns:
- An object to make assertions on the next
Changeof modification (ChangeType.MODIFICATION). - Throws:
AssertJDBException- If there are no moreChangeof modification (ChangeType.MODIFICATION) in the list of changes.- See Also:
-
changeOfModification
Returns assertion methods on theChangeof modification (ChangeType.MODIFICATION) at theindexin parameter.- Parameters:
index- The index corresponding to theChangeof modification (ChangeType.MODIFICATION).- Returns:
- An object to make assertions on the
Changeof modification (ChangeType.MODIFICATION). - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
changeOfDeletion
CH changeOfDeletion()Returns assertion methods on the nextChangeof deletion (ChangeType.DELETION) in the list of changes.- Returns:
- An object to make assertions on the next
Changeof deletion (ChangeType.DELETION). - Throws:
AssertJDBException- If there are no moreChangeof deletion in the list of changes.- See Also:
-
changeOfDeletion
Returns assertion methods on theChangeof deletion (ChangeType.DELETION) at theindexin parameter.- Parameters:
index- The index corresponding to theChangeof deletion (ChangeType.DELETION).- Returns:
- An object to make assertions on the
Changeof deletion (ChangeType.DELETION). - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
changeOnTable
Returns assertion methods on the nextChangeon the tabletableNamein the list of changes.- Parameters:
tableName- The table name- Returns:
- An object to make assertions on the next
Change. - Throws:
AssertJDBException- If there are no moreChangeon the table in the list of changes.- See Also:
-
changeOnTable
- Parameters:
tableName- The table nameindex- The index corresponding to theChange.- Returns:
- An object to make assertions on the
Change. - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
changeOnTableWithPks
Returns assertion methods on theChangeon the tabletableNamecorresponding to the primary key in parameter.- Parameters:
tableName- The table namepksValues- The values of the primary key corresponding to theChange.- Returns:
- An object to make assertions on the
Change. - Throws:
AssertJDBException- If thepksValuesis not found.- See Also:
-
changeOfCreationOnTable
Returns assertion methods on the nextChangeof creation (ChangeType.CREATION) on the tabletableNamein the list of changes.- Parameters:
tableName- The table name- Returns:
- An object to make assertions on the next
Changeof creation (ChangeType.CREATION). - Throws:
AssertJDBException- If there are no moreChangeof creation (ChangeType.CREATION) on the table in the list of changes.- See Also:
-
changeOfCreationOnTable
Returns assertion methods on theChangeof creation (ChangeType.CREATION) on the tabletableNameat theindexin parameter.- Parameters:
tableName- The table nameindex- The index corresponding to theChangeof creation (ChangeType.CREATION).- Returns:
- An object to make assertions on the
Changeof creation (ChangeType.CREATION). - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
changeOfModificationOnTable
Returns assertion methods on the nextChangeof modification (ChangeType.MODIFICATION) on the tabletableNamein the list of changes.- Parameters:
tableName- The table name- Returns:
- An object to make assertions on the next
Changeof modification (ChangeType.MODIFICATION). - Throws:
AssertJDBException- If there are no moreChangeof modification (ChangeType.MODIFICATION) on the table in the list of changes.- See Also:
-
changeOfModificationOnTable
Returns assertion methods on theChangeof modification (ChangeType.MODIFICATION) on the tabletableNameat theindexin parameter.- Parameters:
tableName- The table nameindex- The index corresponding to theChangeof modification (ChangeType.MODIFICATION).- Returns:
- An object to make assertions on the
Changeof modification (ChangeType.MODIFICATION). - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
changeOfDeletionOnTable
Returns assertion methods on the nextChangeof deletion (ChangeType.DELETION) on the tabletableNamein the list of changes.- Parameters:
tableName- The table name- Returns:
- An object to make assertions on the next
Changeof deletion (ChangeType.DELETION). - Throws:
AssertJDBException- If there are no moreChangeof deletion (ChangeType.DELETION) on the table in the list of changes.- See Also:
-
changeOfDeletionOnTable
Returns assertion methods on theChangeof deletion (ChangeType.DELETION) on the tabletableNameat theindexin parameter.- Parameters:
tableName- The table nameindex- The index corresponding to theChangeof deletion (ChangeType.DELETION).- Returns:
- An object to make assertions on the
Changeof deletion (ChangeType.DELETION). - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-