Skip to content
Joel Costigliola edited this page Jun 30, 2013 · 63 revisions

AssertJ documentation

AssertJ is a Java library that provides a fluent interface for writing assertions. Its main goal is to improve test code readability and make maintenance of tests easier.

AssertJ requires Java SE 6.0 or later and can be used with either JUnit or TestNG.

Latest news

  • 2013-06-30 : AssertJ core 1.3.0 release
  • 2013-05-12 : AssertJ core 1.2.0 release
  • 2013-04-15 : AssertJ core 1.1.0 release
  • 2013-03-26 : AssertJ first train release (core, guava, joda-time and assertions generator)
  • 2013-03-13 : Fork from FEST Assert

See New and noteworthy in AssertJ for details.

Getting started

Quick start : just have a look at our One minute starting guide!

Replace JUnit assertions by AssertJ assertions : we have a guide to easily convert JUnit assertions to AssertJ, check this page (note also that we plan to write an eclipse plugin to do this conversion task).

If you were using FEST 1.4, have a look at our migration guide, but don't worry, migration is not hard.

If you have any questions, please use AssertJ google group.

Working with AssertJ

  1. New and noteworthy in AssertJ
  2. Using AssertJ
  3. Extending AssertJ
    1. Using custom conditions
    2. Creating your own specific assertion
  4. Tips and tricks
  5. Learn by examples

AssertJ modules

In addition to java core assertions, AssertJ modules provides assertions for :

Although AssertJ core can be used with Android, I suggest to use Fest assertions for Android (provided by Square), it's not an AssertJ module but it is very useful.

Why having forked Fest Assert ?

AssertJ is a fork of FEST Assert a great project I have contributed to during 3 years, so why having forked it ?

Well there are two main reasons :

  • FEST 2.0 will only provide a limited set of assertions, far less than Fest 2.0M10 and even less than FEST 1.x.
  • FEST is not enough open to users demands and contributions.

On the contrary AssertJ goal is to provide a rich set of assertions and any resonable requests to enrich AssertJ assertions is welcome as we know it will be useful to someone. Said otherwise, AssertJ is community driven, we listen to our users because AssertJ is built for them.

If you feel that some assertion is missing, please fill a ticket or even better make a contribution !

Joel Costigliola (AssertJ creator)

Mailing list

You can ask questions and make suggestions on AssertJ google group.

Contributing to AssertJ

You are very welcome to contribute, we really want to offer the richer and easy to use assertions API, so ideas from our users are very appreciated.

Contributing is easy and we try to help people contributing, have a look at the contributor guidelines (these are the same guidelines shown when you create a new issue).

Special thanks to William Delanoue, Mikhail Mazursky and Jean Christophe Gay for their contributions to assertj-core.

Thanks

AssertJ has its roots in FEST Assert, a project I have contributed on for 3 years, so thanks to Alex Ruiz FEST's creator !

Many thanks to Cloudbees for their FOSS program that allows AssertJ to have a Jenkins CI server.

Migration Guides

v3.25 → v4.0

Clone this wiki locally