Fluent assertions for java

// unique entry point to get access to all assertThat methods and utility methods (e.g. entry)
import static org.assertj.core.api.Assertions.*;

// common assertions

// String specific assertions

// collection specific assertions
                               .contains(frodo, sam)

// using extracting magical feature to check fellowshipOfTheRing characters name :)
assertThat(fellowshipOfTheRing).extracting("name").contains("Boromir", "Gandalf", "Frodo", "Legolas")
                                                  .doesNotContain("Sauron", "Elrond");

// map specific assertions, ringBearers initialized with the elves rings and the one ring bearers.
                       .contains(entry(oneRing, frodo), entry(nenya, galadriel))
                       .doesNotContainEntry(oneRing, aragorn);

// and many more assertions : dates, file, numbers, exceptions ...

Want to see more features ? Jump to the highlights section.

Rich and easy to use

AssertJ provides a rich set of assertions, truly-helpful error messages, it improves test code readability and has been designed to be super easy to use within your favorite IDE.

Get started right away with the one minute starting guide, have a look at some AssertJ great features or stay tune with the latest releases.

If you are convinced by AssertJ, you can automatically convert your JUnit assertions to AssertJ


You can easily write assertions for your own classes, it will make your test assertions reflect the domain, it's a way to use ubiquitous language in your tests !

We provide an assertion generator to quickly create assertions for your domain model classes.

Community driven

AssertJ only exists to help the dev community, we listen to users ideas to provide the most useful assertions.

AssertJ is a fork of the great Fest Assert library which is no more active these days.

AssertJ will remain open and free forever.

AssertJ provides assertions for popular libraries


Provides assertions for Guava types like Multimap, Table, Optional or ByteSource.

Check AssertJ Guava assertions latest news and documentation.

Joda Time

Provides assertions for Joda Time like DateTime and LocalDateTime. More will come later, contributions are very welcome !

Check AssertJ Joda Time assertions latest news and documentation.


Provides assertions for Neo4J

Check AssertJ Neo4J assertions latest news and documentation.

Neo4J assertions have been developped by Florent Biville.