public class AssertUtils extends Object
Modifier and Type | Method | Description |
---|---|---|
static void |
assertEquals(String message,
Object expected,
Object actual) |
Asserts that two objects are either both null or are equal according to
Object.equals(Object) . |
static boolean |
equal(Object first,
Object second) |
Determines if two objects are both null or are equal according to
Object.equals(Object) . |
public static boolean equal(Object first, Object second)
Object.equals(Object)
.first
- the first object to comparesecond
- the second object to comparetrue
if both objects are null,
or first
is non-null and first.equals(second)
,
false
otherwiseObject.equals(Object)
public static void assertEquals(String message, Object expected, Object actual)
Object.equals(Object)
. If not, an AssertionError
is thrown. If the objects are
not equal, but the types of two objects are compatible for equality, then the differences as
determined by Pojomatic.diff(Object, Object)
are included in the failure message.message
- the message to add if the assertion failsexpected
- will be displayed first if the assertion failsactual
- will be displayed second if the assertion failsAssertionError
- if the objects are not equal. Throwable.getMessage()
will
include information about the differencesCopyright © 2008–2018. All rights reserved.