public final class Assertions extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertEqualsAndHashCode(Class<?> clazz,
AssertEqualsAndHashCodeArguments arguments)
Asserts that the methods
Object.equals(Object) and
Object.hashCode() of objects created by executing the clazzes
constructor work as defined by arguments. |
static void |
assertEqualsAndHashCode(Function<Object[],?> constructor,
AssertEqualsAndHashCodeArguments arguments)
Asserts that the methods
Object.equals(Object) and
Object.hashCode() of objects created by executing constructor
work as defined by arguments. |
public static void assertEqualsAndHashCode(Class<?> clazz, AssertEqualsAndHashCodeArguments arguments)
Object.equals(Object) and
Object.hashCode() of objects created by executing the clazzes
constructor work as defined by arguments.
The constructor of clazz is called multiple times using different
combinations of arguments. The resulting objects equality is checked using
declarations of arguments.
Reflects.create(Reflect, Object...) is used to construct instances of
clazz.
arguments declares two kind of valid arguments for the class
constructor and if changing the argument should change the objects equality.
In addition to argument checks Object.equals(Object) is checked
against null, true and the object itself while the first two
are expected to differ from the object itself.
clazz - class to be instantiated based on given argumentsarguments - declaration of arguments and if changing arguments should
change equalitypublic static void assertEqualsAndHashCode(Function<Object[],?> constructor, AssertEqualsAndHashCodeArguments arguments)
Object.equals(Object) and
Object.hashCode() of objects created by executing constructor
work as defined by arguments.
constructor is called multiple times using different combinations of
arguments. The resulting objects equality is checked using declarations of
arguments.
arguments declares two kind of valid arguments for the constructor
and if changing the argument should change the objects equality.
In addition to argument checks Object.equals(Object) is checked
against null, true and the object itself while the first two
are expected to differ from the object itself.
constructor - function to construct object instances based on given
argumentsarguments - declaration of arguments and if changing arguments should
change equalityCopyright © 2020. All rights reserved.