Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

FEST Assertions Module has moved to Github !

Check this page :https://github.com/alexruiz/fest-assert-2.x/wiki

The documentation below is for Fest 1.x which is no more maintained, we are focusing our effort to the 2.x version !

Starting with version 1.2, FEST-Assert supports custom error messages, replacing the default ones.

For example, the following assertion:

Code Block
java
java

assertThat("Luke").isEqualTo("Yoda");

will fail with the following default message:

No Format

expected:<'[Yoda]'> but was:<'[Luke]'>

By using the method overridingErrorMessage(String) we can provide our own error message. From the previous example:

Code Block
java
java

assertThat("Luke").overridingErrorMessage("'Luke' is not 'Yoda'")
                  .isEqualTo("Yoda");

will fail with the message:

No Format

'Luke' is not 'Yoda'