public abstract class AssertionErrors
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
assertEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Assert two objects are equal raise an
AssertionError if not. |
static void |
assertTrue(java.lang.String message,
boolean condition)
Assert the given condition is
true and raise an
AssertionError if it is not. |
static void |
fail(java.lang.String message)
Fails a test with the given message.
|
static void |
fail(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Fails a test with the given message passing along expected and actual
values to be added to the message.
|
public static void fail(java.lang.String message)
message
- describes the reason for the failurepublic static void fail(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
For example given:
assertEquals("Response header [" + name + "]", actual, expected);
The resulting message is:
Response header [Accept] expected:<application/json> but was:<text/plain>
message
- describes the value that failed the matchexpected
- expected valueactual
- actual valuepublic static void assertTrue(java.lang.String message, boolean condition)
true
and raise an
AssertionError
if it is not.message
- the messagecondition
- the condition to test forpublic static void assertEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
AssertionError
if not.
For example:
assertEquals("Response header [" + name + "]", actual, expected);
message
- describes the value being checkedexpected
- the expected valueactual
- the actual value