Skip to end of metadata
Go to start of metadata

FEST Assertions Module has moved to Github !

Check this page :

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


Assertions classes provided by FEST-Assert can be extended by using custom conditions (instances of org.fest.assertions.Condition.)

For example, the following condition verifies that the characters in a String are in uppercase:

This example shows how to use such condition:

which will fail with the message:

[Greeting] actual value:<'hello'> should satisfy condition:<Uppercase>

New in 1.2: "is" and "isNot"

FEST-Assert also provides the methods is and isNot, which are aliases for satisfies and doesNotSatisfy respectively. These aliases work exactly the same as the original methods, with the difference that they can improve readability in certain cases.

In our previous example, we can change the name of the static factory method isUppercase to simply uppercase:

and use the alias is:

which is shorter and easy to read than the original version!

  • No labels