Using AssertJ and Awaitility together thanks to Java 8 and lambdas
AssertJ and Awaitility are two of my favorites tools using in automatic code testing. Unfortunately until recently it was not possible to use it together. But then Java 8 entered the game and several...
View ArticleSpice up your test code with custom assertions
Inspired by the @tkaczanowski talk during GeeCON conference I decided to have a closer look at custom assertions with AssertJ library. In my ‘Dice’ game I created a ‘Chance’ that is any combination of...
View ArticleJava 8 Friday: Most Internal DSLs are Outdated
At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re...
View ArticleJUnit: Testing Exceptions with Java 8 and AssertJ 3.0.0
AssertJ 3.0.0 release for Java 8 makes testing exceptions much easier than before. In one of my previous blog post I described how to utilize plain Java 8 to achieve this, but with AssertJ 3.0.0 much...
View ArticleAssertJ’s SoftAssertions – do we need them?
One of the rules of writing good unit test is that it should fail for one reason, so unit test should test one logical concept. Sometime it is quite tough to have a single assertion per test. To follow...
View ArticleModern TDD-oriented Java 8 JUnit test template for Idea (with Mockito and...
Tune up your JUnit test class template for Idea with the BDD-like syntax, Java 8 and the Mockito-AssertJ duo. Topics covered in this article may seem trivial. However, from my trainer experience I know...
View ArticleJUnit 5 meets AssertJ
JUnit 5 brings a lot of improvements in the assertions library, mainly thanks to Java 8 and Lambda Expression support and thanks to the presence of the new assertions like assertAll, assertTimeout...
View ArticleClean Code from the Trenches – Writing Executable Specifications with JUnit...
Executable Specifications are tests that can also serve as design specifications. They enable technical and business teams to get on the same page by enabling the use of a common language (in DDD-world...
View ArticleAll Your Tests Belong to You: Maintaining Mixed JUnit 4/JUnit 5 and...
If you are seasoned Java developer who practices test-driven development (hopefully, everyone does it), it is very likely JUnit 4 has been your one-stop-shop testing toolbox. Personally, I truly loved...
View Article
More Pages to Explore .....