JUnit 5 + AssertJ examples

In this article, we will show you how to write test assertions with AssertJ. P.S Tested with JUnit 5.5.2 and AssertJ 3.14.0 pom.xml <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <version>5.5.2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>3.14.0</version> <scope>test</scope> </dependency> 1. JUnit 5 assertions to AssertJ It’s easy to convert JUnit 5 assertions to AssetJ, see the following syntax: JUnit …

Read more