Thanks to visit codestin.com
Credit goes to openrewrite.github.io

Skip to main content

Intro

Today, we're going to break your old testing habits and learn some new ones.

This workshop consists of several sections, each focusing on a different aspect of improving your testing practices.

  1. Bad habits - We'll start by exploring some common but outdated testing patterns, and ways to improve them.
  2. Old habits - After that, we'll look at legacy testing frameworks and libraries that are still in use today.
  3. JUnit Jupiter - Next, we'll upgrade to JUnit 6 and learn its new features.
  4. Adopt AssertJ - Then, we'll dive into AssertJ for more expressive assertions.
  5. Advanced AssertJ - Finally, we'll master fluent assertions for cleaner and more maintainable tests.

Getting Started

Clone the repository

To get started, clone the workshop repository:

git clone https://github.com/openrewrite/break-your-testing-habits.git
cd break-your-testing-habits

This repository contains example code that you'll use throughout the workshop to explore the topics, write tests, and practice refactoring techniques.

Workshop structure

We recommend going through the sections in order, but you're welcome to go at your own pace. There is a lot of material to cover, so feel free to take breaks and revisit sections as needed.

You're also welcome to use your own projects to try out the improvements alongside the provided examples.

What you'll need

  • Java 8+, to run recipes
  • Gradle 4.10+, or
  • Maven 3+
  • Java 21+, to develop recipes