Class ChangeAssert
- All Implemented Interfaces:
org.assertj.core.api.Descriptable<ChangeAssert>
,AssertOnChangeType<ChangeAssert>
,AssertOnDataType<ChangeAssert>
,AssertOnModifiedColumns<ChangeAssert>
,AssertOnNumberOfColumns<ChangeAssert>
,AssertOnPrimaryKey<ChangeAssert>
,ChangeElement
,Element
,Navigation
,Origin
,OriginWithChanges<ChangesAssert,
,ChangeAssert> OriginWithColumnsAndRowsFromChange<ChangesAssert,
,ChangeAssert, ChangeColumnAssert, ChangeRowAssert> ToChange<ChangeAssert>
,ToChanges<ChangesAssert>
,ToColumn<ChangeColumnAssert>
,ToColumnFromChange<ChangeColumnAssert>
,ToRowFromChange<ChangeRowAssert>
Change
.- Author:
- Régis Pouiller
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Change
The actual change on which the assertion is.Fields inherited from class org.assertj.db.api.AbstractAssertWithOrigin
origin
Fields inherited from class org.assertj.db.global.AbstractElement
info, myself
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolumn()
column
(int index) Returns assertion methods on theColumn
at theindex
in parameter.Returns assertion methods on theColumn
corresponding to the column name in parameter.columnAmongTheModifiedOnes
(int index) columnAmongTheModifiedOnes
(String columnName) hasModifiedColumns
(Integer... indexes) Verifies that the indexes of columns with a modification in the values between the start point and the end point is equals to the parameters.hasModifiedColumns
(String... names) Verifies that the names of columns with a modification in the values between the start point and the end point is equals to the parameters.hasNumberOfColumns
(int expected) Verifies that the number of columns is equal to the number in parameter.hasNumberOfColumnsGreaterThan
(int expected) Verifies that the number of columns is greater than the number in parameter.hasNumberOfColumnsGreaterThanOrEqualTo
(int expected) Verifies that the number of columns is greater than or equal to the number in parameter.hasNumberOfColumnsLessThan
(int expected) Verifies that the number of columns is less than the number in parameter.hasNumberOfColumnsLessThanOrEqualTo
(int expected) Verifies that the number of columns is less than or equal to the number in parameter.hasNumberOfModifiedColumns
(int number) Verifies that the number of columns with a modification in the values between the start point and the end point is equals to the number in parameter.hasNumberOfModifiedColumnsGreaterThan
(int number) Verifies that the number of columns with a modification in the values between the start point and the end point is greater than the number in parameter.hasNumberOfModifiedColumnsGreaterThanOrEqualTo
(int number) Verifies that the number of columns with a modification in the values between the start point and the end point is greater than or equal to the number in parameter.hasNumberOfModifiedColumnsLessThan
(int number) Verifies that the number of columns with a modification in the values between the start point and the end point is less than the number in parameter.hasNumberOfModifiedColumnsLessThanOrEqualTo
(int number) Verifies that the number of columns with a modification in the values between the start point and the end point is less than or equal to the number in parameter.hasPksNames
(String... names) Verifies that the columns og the primary key of the rows of the change is the same as the parameters.hasPksValues
(Object... values) Verifies that the values of the primary key of the rows of the change are the same as the parameters.Verifies that the type of the change is a creation.Verifies that the type of the change is a deletion.Verifies that the type of the change is a modification.isOfType
(ChangeType expected) Verifies that the type of the change is equal to the type in parameter.isOnDataType
(DataType expected) Verifies that the data type on which is the change is equal to the type in parameter.Verifies that the data type on which is the change is a request.Verifies that the data type on which is the change is a table.Verifies that the change is on a table with the name in parameter.Returns to level of assertion methods onChanges
.Returns assertion methods on theRow
at end point.Returns assertion methods on theRow
at start point.Methods inherited from class org.assertj.db.api.AbstractAssertWithOriginWithChanges
change, change, changeOfCreation, changeOfCreation, changeOfCreationOnTable, changeOfCreationOnTable, changeOfDeletion, changeOfDeletion, changeOfDeletionOnTable, changeOfDeletionOnTable, changeOfModification, changeOfModification, changeOfModificationOnTable, changeOfModificationOnTable, changeOnTable, changeOnTable, changeOnTableWithPks, ofAll, ofCreation, ofCreationOnTable, ofDeletion, ofDeletionOnTable, ofModification, ofModificationOnTable, onTable
Methods inherited from class org.assertj.db.api.AbstractAssertWithOrigin
returnToOrigin
Methods inherited from class org.assertj.db.global.AbstractElement
as, as, describedAs, describedAs, getInfo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as
Methods inherited from interface org.assertj.db.navigation.ToChange
change, change, changeOfCreation, changeOfCreation, changeOfCreationOnTable, changeOfCreationOnTable, changeOfDeletion, changeOfDeletion, changeOfDeletionOnTable, changeOfDeletionOnTable, changeOfModification, changeOfModification, changeOfModificationOnTable, changeOfModificationOnTable, changeOnTable, changeOnTable, changeOnTableWithPks
Methods inherited from interface org.assertj.db.navigation.ToChanges
ofAll, ofCreation, ofCreationOnTable, ofDeletion, ofDeletionOnTable, ofModification, ofModificationOnTable, onTable
-
Field Details
-
change
The actual change on which the assertion is.
-
-
Constructor Details
-
Method Details
-
rowAtStartPoint
Returns assertion methods on theRow
at start point.- Specified by:
rowAtStartPoint
in interfaceToRowFromChange<ChangeRowAssert>
- Returns:
- An object to make assertions on the
Row
at start point. - See Also:
-
rowAtEndPoint
Returns assertion methods on theRow
at end point.- Specified by:
rowAtEndPoint
in interfaceToRowFromChange<ChangeRowAssert>
- Returns:
- An object to make assertions on the
Row
at end point. - See Also:
-
column
- Specified by:
column
in interfaceToColumn<ChangeColumnAssert>
- Returns:
- An object to make assertions on the next
Column
. - See Also:
-
column
Returns assertion methods on theColumn
at theindex
in parameter.- Specified by:
column
in interfaceToColumn<ChangeColumnAssert>
- Parameters:
index
- The index corresponding to theColumn
.- Returns:
- An object to make assertions on the
Column
. - See Also:
-
column
Returns assertion methods on theColumn
corresponding to the column name in parameter.- Specified by:
column
in interfaceToColumn<ChangeColumnAssert>
- Parameters:
columnName
- The column name.- Returns:
- An object to make assertions on the
Column
. - See Also:
-
columnAmongTheModifiedOnes
- Specified by:
columnAmongTheModifiedOnes
in interfaceToColumnFromChange<ChangeColumnAssert>
- Returns:
- An object to make assertions on the
Column
. - See Also:
-
columnAmongTheModifiedOnes
- Specified by:
columnAmongTheModifiedOnes
in interfaceToColumnFromChange<ChangeColumnAssert>
- Parameters:
index
- The index corresponding to theColumn
among the list of modifiedColumn
s..- Returns:
- An object to make assertions on the
Column
. - See Also:
-
columnAmongTheModifiedOnes
Returns assertion methods on theColumn
corresponding to the column name in parameter among the modifiedColumn
s.- Specified by:
columnAmongTheModifiedOnes
in interfaceToColumnFromChange<ChangeColumnAssert>
- Parameters:
columnName
- The column name.- Returns:
- An object to make assertions on the
Column
. - See Also:
-
isOnDataType
Verifies that the data type on which is the change is equal to the type in parameter.Example where the assertion verifies that the change is on data type
TABLE
:assertThat(changes).change(1).isOnDataType(DataType.TABLE);
- Specified by:
isOnDataType
in interfaceAssertOnDataType<ChangeAssert>
- Parameters:
expected
- The expected type to compare to.- Returns:
this
assertion object.- See Also:
-
isOnTable
Verifies that the data type on which is the change is a table.Example where the assertion verifies that the change is on data type
TABLE
:assertThat(changes).change(1).isOnTable();
This assertion method is equivalent to :
xxxxx.isOnDataType(DataType.TABLE);
- Specified by:
isOnTable
in interfaceAssertOnDataType<ChangeAssert>
- Returns:
this
assertion object.- See Also:
-
isOnRequest
Verifies that the data type on which is the change is a request.Example where the assertion verifies that the change is on data type
REQUEST
:assertThat(changes).change(1).isOnRequest();
This assertion method is equivalent to :
xxxxx.isOnDataType(DataType.REQUEST);
- Specified by:
isOnRequest
in interfaceAssertOnDataType<ChangeAssert>
- Returns:
this
assertion object.- See Also:
-
isOnTable
Verifies that the change is on a table with the name in parameter.Example where the assertion verifies that the change is on
TABLE
called movie :assertThat(changes).change(1).isOnTable("movie");
- Specified by:
isOnTable
in interfaceAssertOnDataType<ChangeAssert>
- Parameters:
name
- The name of the table on which is the change.- Returns:
this
assertion object.- See Also:
-
hasPksNames
Verifies that the columns og the primary key of the rows of the change is the same as the parameters.Example where the assertion verifies that primary key is the column called id :
assertThat(changes).change(1).hasPksNames("id");
- Specified by:
hasPksNames
in interfaceAssertOnPrimaryKey<ChangeAssert>
- Parameters:
names
- The names of the primary key associated with the rows of the change.- Returns:
this
assertion object.- See Also:
-
hasPksValues
Verifies that the values of the primary key of the rows of the change are the same as the parameters.Example where the assertion verifies that primary key have the value 1 :
assertThat(changes).change(1).hasPksValues(1);
- Specified by:
hasPksValues
in interfaceAssertOnPrimaryKey<ChangeAssert>
- Parameters:
values
- The values of the primary key associated with the rows of the change.- Returns:
this
assertion object.- See Also:
-
isOfType
Verifies that the type of the change is equal to the type in parameter.Example where the assertion verifies that the change is of type
CREATION
:assertThat(changes).change(1).isOfType(ChangeType.CREATION);
- Specified by:
isOfType
in interfaceAssertOnChangeType<ChangeAssert>
- Parameters:
expected
- The expected type to compare to.- Returns:
this
assertion object.- See Also:
-
isCreation
Verifies that the type of the change is a creation.Example where the assertion verifies that the change is a creation :
assertThat(changes).change(1).isCreation();
This assertion method is equivalent to :
xxxxx.isOfType(ChangeType.CREATION);
- Specified by:
isCreation
in interfaceAssertOnChangeType<ChangeAssert>
- Returns:
this
assertion object.- See Also:
-
isModification
Verifies that the type of the change is a modification.Example where the assertion verifies that the change is a modification :
assertThat(changes).change(1).isModification();
This assertion method is equivalent to :
xxxxx.isOfType(ChangeType.MODIFICATION);
- Specified by:
isModification
in interfaceAssertOnChangeType<ChangeAssert>
- Returns:
this
assertion object.- See Also:
-
isDeletion
Verifies that the type of the change is a deletion.Example where the assertion verifies that the change is a deletion :
assertThat(changes).change(1).isDeletion();
This assertion method is equivalent to :
xxxxx.isOfType(ChangeType.DELETION);
- Specified by:
isDeletion
in interfaceAssertOnChangeType<ChangeAssert>
- Returns:
this
assertion object.- See Also:
-
hasNumberOfModifiedColumns
Verifies that the number of columns with a modification in the values between the start point and the end point is equals to the number in parameter.Example where the assertion verifies that there are 3 modified columns :
assertThat(changes).change(1).hasNumberOfModifiedColumns(3);
- Specified by:
hasNumberOfModifiedColumns
in interfaceAssertOnModifiedColumns<ChangeAssert>
- Parameters:
number
- The expected number of modified columns- Returns:
this
assertion object.- See Also:
-
hasNumberOfModifiedColumnsGreaterThan
Verifies that the number of columns with a modification in the values between the start point and the end point is greater than the number in parameter.Example where the assertion verifies that there are greater than 3 modified columns :
assertThat(changes).change(1).hasNumberOfModifiedColumnsGreaterThan(3);
- Specified by:
hasNumberOfModifiedColumnsGreaterThan
in interfaceAssertOnModifiedColumns<ChangeAssert>
- Parameters:
number
- The expected number of modified columns- Returns:
this
assertion object.- See Also:
-
hasNumberOfModifiedColumnsLessThan
Verifies that the number of columns with a modification in the values between the start point and the end point is less than the number in parameter.Example where the assertion verifies that there are less than 3 modified columns :
assertThat(changes).change(1).hasNumberOfModifiedColumnsLessThan(3);
- Specified by:
hasNumberOfModifiedColumnsLessThan
in interfaceAssertOnModifiedColumns<ChangeAssert>
- Parameters:
number
- The expected number of modified columns- Returns:
this
assertion object.- See Also:
-
hasNumberOfModifiedColumnsGreaterThanOrEqualTo
Verifies that the number of columns with a modification in the values between the start point and the end point is greater than or equal to the number in parameter.Example where the assertion verifies that there are ar least 3 modified columns :
assertThat(changes).change(1).hasNumberOfModifiedColumnsGreaterThanOrEqualTo(3);
- Specified by:
hasNumberOfModifiedColumnsGreaterThanOrEqualTo
in interfaceAssertOnModifiedColumns<ChangeAssert>
- Parameters:
number
- The expected number of modified columns- Returns:
this
assertion object.- See Also:
-
hasNumberOfModifiedColumnsLessThanOrEqualTo
Verifies that the number of columns with a modification in the values between the start point and the end point is less than or equal to the number in parameter.Example where the assertion verifies that there are at most 3 modified columns :
assertThat(changes).change(1).hasNumberOfModifiedColumnsLessThanOrEqualTo(3);
- Specified by:
hasNumberOfModifiedColumnsLessThanOrEqualTo
in interfaceAssertOnModifiedColumns<ChangeAssert>
- Parameters:
number
- The expected number of modified columns- Returns:
this
assertion object.- See Also:
-
hasModifiedColumns
Verifies that the indexes of columns with a modification in the values between the start point and the end point is equals to the parameters.Example where the assertion verifies that indexes of modified columns are 3 and 5 :
assertThat(changes).change(1).hasModifiedColumns(3, 5);
- Specified by:
hasModifiedColumns
in interfaceAssertOnModifiedColumns<ChangeAssert>
- Parameters:
indexes
- Indexes of the modified columns.- Returns:
this
assertion object.- See Also:
-
hasModifiedColumns
Verifies that the names of columns with a modification in the values between the start point and the end point is equals to the parameters.Example where the assertion verifies that names of modified columns are "name" and "birth" :
assertThat(changes).change(1).hasModifiedColumns("name", "birth");
- Specified by:
hasModifiedColumns
in interfaceAssertOnModifiedColumns<ChangeAssert>
- Parameters:
names
- Names of the modified columns.- Returns:
this
assertion object.- See Also:
-
hasNumberOfColumns
Verifies that the number of columns is equal to the number in parameter.Example where the assertion verifies that the table has 8 columns :
assertThat(table).hasNumberOfColumns(8);
Example where the assertion verifies that the first row of the table has 8 columns :
assertThat(table).row().hasNumberOfColumns(8);
Example where the assertion verifies that the row at end point of the first change has 8 columns :
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumns(8);
- Specified by:
hasNumberOfColumns
in interfaceAssertOnNumberOfColumns<ChangeAssert>
- Parameters:
expected
- The number to compare to the number of columns.- Returns:
this
assertion object.- See Also:
-
hasNumberOfColumnsGreaterThan
Verifies that the number of columns is greater than the number in parameter.Example where the assertion verifies that the table has more than 8 columns :
assertThat(table).hasNumberOfColumnsGreaterThan(8);
Example where the assertion verifies that the first row of the table has more than 8 columns :
assertThat(table).row().hasNumberOfColumnsGreaterThan(8);
Example where the assertion verifies that the row at end point of the first change has more than 8 columns :
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsGreaterThan(8);
- Specified by:
hasNumberOfColumnsGreaterThan
in interfaceAssertOnNumberOfColumns<ChangeAssert>
- Parameters:
expected
- The number to compare to the number of columns.- Returns:
this
assertion object.- See Also:
-
hasNumberOfColumnsLessThan
Verifies that the number of columns is less than the number in parameter.Example where the assertion verifies that the table has less than 8 columns :
assertThat(table).hasNumberOfColumnsLessThan(8);
Example where the assertion verifies that the first row of the table has less than 8 columns :
assertThat(table).row().hasNumberOfColumnsLessThan(8);
Example where the assertion verifies that the row at end point of the first change has less than 8 columns :
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsLessThan(8);
- Specified by:
hasNumberOfColumnsLessThan
in interfaceAssertOnNumberOfColumns<ChangeAssert>
- Parameters:
expected
- The number to compare to the number of columns.- Returns:
this
assertion object.- See Also:
-
hasNumberOfColumnsGreaterThanOrEqualTo
Verifies that the number of columns is greater than or equal to the number in parameter.Example where the assertion verifies that the table has at least 8 columns :
assertThat(table).hasNumberOfColumnsGreaterThanOrEqualTo(8);
Example where the assertion verifies that the first row of the table has at least 8 columns :
assertThat(table).row().hasNumberOfColumnsGreaterThanOrEqualTo(8);
Example where the assertion verifies that the row at end point of the first change has at least 8 columns :
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsGreaterThanOrEqualTo(8);
- Specified by:
hasNumberOfColumnsGreaterThanOrEqualTo
in interfaceAssertOnNumberOfColumns<ChangeAssert>
- Parameters:
expected
- The number to compare to the number of columns.- Returns:
this
assertion object.- See Also:
-
hasNumberOfColumnsLessThanOrEqualTo
Verifies that the number of columns is less than or equal to the number in parameter.Example where the assertion verifies that the table has at most 8 columns :
assertThat(table).hasNumberOfColumnsLessThanOrEqualTo(8);
Example where the assertion verifies that the first row of the table has at most 8 columns :
assertThat(table).row().hasNumberOfColumnsLessThanOrEqualTo(8);
Example where the assertion verifies that the row at end point of the first change has at most 8 columns :
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsLessThanOrEqualTo(8);
- Specified by:
hasNumberOfColumnsLessThanOrEqualTo
in interfaceAssertOnNumberOfColumns<ChangeAssert>
- Parameters:
expected
- The number to compare to the number of columns.- Returns:
this
assertion object.- See Also:
-
returnToChanges
Returns to level of assertion methods onChanges
.- Returns:
- a object of assertion methods on
Changes
.
-