We are proud to announce that FEST-Assert 1.2 is out!
FEST-Assert is an “assertThat” library that provides a fluent interface for writing assertions. Its main goal is to improve test code readability and make maintenance of tests easier.
Example:
int removed = employees.removeFired(); assertThat(removed).isZero(); List newEmployees = employees.hired(TODAY); assertThat(newEmployees).hasSize(6) .contains(frodo, sam); String[] newHires = employees.newHiresNames(); assertThat(newHires).containsOnly("Gandalf", "Arwen", "Gimli"); assertThat(yoda).isInstanceOf(Jedi.class) .isEqualTo(foundJedi) .isNotEqualTo(foundSith);
Release notes
Bug
- [FEST-198] – Fix
ImageAssert.readto compile successfully against Java 1.5 - [FEST-218] – Inconsistency in parameter names in assertions
- [FEST-228] – Error message when comparing
Strings is not consistent between JUnit and TestNG - [FEST-229] –
Descriptions are not evaluated lazily when an assertion fails - [FEST-230] – Validation of arguments not throwing correct
Exceptions.
Improvement
- [FEST-147] – Allow reuse of formatting helpers in class
Formattingby making thempublicprotected - [FEST-157] – Add
isNotEqualByComparingTo()for ease of use inBigDecimalAssert - [FEST-165] – Make
Assertionsnon-final and make its constructor protected - [FEST-166] – Make assertion classes non-final
- [FEST-168] – Add methods "
is" and "isNot" to all assertions - [FEST-242] – Nicer debugging output with JUnit’s
ComparisonFailure - [FEST-245] – Deprecate ‘Delta’ class in
FloatAssertand replace it with top-levelDeltaclass
New Feature
- [FEST-234] – Add support to specify custom failure messages, overriding the default ones.
Task
- [FEST-223] – Reorganize tests and migrate them to JUnit (to use Infinitest)
For more details about new, updated or removed classes, please read the change report.
You can download the latest release here (file fest-assert-1.2.zip.) FEST-Assert requires Java SE 5.0 or later.
Here are some useful links:
Feedback is always appreciated :)
My name is Alex Ruiz. I'm a programmer with special interest in Java, API design, testing and OOP. I'm the creator of 


#1 by Piotr Jagielski on July 17, 2010 - 4:52 am
Thank you for creating this wonderful library! I praised it at my blog at http://piotrjagielski.com/blog/custom-assertions-in-fest-assert/
#2 by Alex Ruiz on July 17, 2010 - 9:39 am
Thanks Piotr! Nice article! :)
Cheers!