AssertionErrors (Spring Framework 3.2.1.RELEASE API)
Date: 2013-01-24

org.springframework.test.util

## Class AssertionErrors

- java.lang.Object
- - org.springframework.test.util.AssertionErrors

-     public abstract class AssertionErrors
      extends Object

  JUnit independent assertion class.
  Since:
    3.2
  Author:
    Lukas Krecan, Arjen Poutsma

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `assertEquals(String message, Object expected, Object actual)` Assert two objects are equal raise an `AssertionError` if not.
    `static void` | `assertTrue(String message, boolean condition)` Assert the given condition is `true` and raise an `AssertionError` if it is not.
    `static void` | `fail(String message)` Fails a test with the given message.
    `static void` | `fail(String message, Object expected, Object actual)` Fails a test with the given message passing along expected and actual values to be added to the message.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### fail

          public static void fail(String message)

      Fails a test with the given message.
      Parameters:
        `message` - describes the reason for the failure

    - #### fail

          public static void fail(String message,
                  Object expected,
                  Object actual)

      Fails a test with the given message passing along expected and actual values to be added to the message.

      For example given:

           assertEquals("Response header [" + name + "]", actual, expected);

      The resulting message is:

           Response header [Accept] expected:<application/json> but was:<text/plain>

      Parameters:
        `message` - describes the value that failed the match
        `expected` - expected value
        `actual` - actual value

    - #### assertTrue

          public static void assertTrue(String message,
                        boolean condition)

      Assert the given condition is `true` and raise an `AssertionError` if it is not.
      Parameters:
        `message` - the message
        `condition` - the condition to test for

    - #### assertEquals

          public static void assertEquals(String message,
                          Object expected,
                          Object actual)

      Assert two objects are equal raise an `AssertionError` if not.

      For example:

           assertEquals("Response header [" + name + "]", actual, expected);

      Parameters:
        `message` - describes the value being checked
        `expected` - the expected value
        `actual` - the actual value