AssertJ Core
AssertJ is a Java library that enables developers to create concise and readable test code. The power of AssertJ is shown by one of their nice examples on the docs page:
assertThat(fellowshipOfTheRing).hasSize(9)
.contains(frodo, sam)
.doesNotContain(sauron);
AssertJ has an extensive collection of assertions, making the possibilities almost endless. It is an alternative to JUnit’s own assertion module, offering clearer and more specific options. A nice example comes from the assertEquals
, where AssertJ clarifies the positions of the expected / actual values:
// JUnit
assertEquals(42, 40 + 2);
// AssertJ
assertThat(40 + 2).isEqualTo(42);
In our project, we focus on the core module containing the assertions for standard JDK types.
Authors
CS MSc Student at TU Delft and Student Assistant at QuTech. Enjoys learning about quantum communication, sustainability, and a bunch of other topics.
Software engineer interested in concepts of programming languages, software quality, and functional programming. TA and Master student at TU Delft.
Master Computer Science student and Teaching Assistant at TU Delft. Specialising in Bioinformatics. I like testing my software well and writing beautiful code. Also check out my Advent of Code repo.