Package org.assertj.db.api.assertions
Interface AssertOnPrimaryKey<T extends AssertOnPrimaryKey<T>>
- Type Parameters:
T
- The "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
- All Known Implementing Classes:
ChangeAssert
public interface AssertOnPrimaryKey<T extends AssertOnPrimaryKey<T>>
Defines the assertion methods on a primary key.
- Author:
- Régis Pouiller
-
Method Summary
Modifier and TypeMethodDescriptionhasPksNames
(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.
-
Method Details
-
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");
- Parameters:
names
- The names of the primary key associated with the rows of the change.- Returns:
this
assertion object.- Throws:
AssertionError
- If the columns of the primary key are different to the names in parameters.NullPointerException
- If one of the names in parameters isnull
.- 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);
- Parameters:
values
- The values of the primary key associated with the rows of the change.- Returns:
this
assertion object.- Throws:
AssertionError
- If the values of the primary key are different to the values in parameters.- See Also:
-