Monitor Unit Tests With TestWatcher

1. Overview In this tutorial, we'll investigate how we can monitor unit tests using JUnit test rules. JUnit provides the TestWatcher class as a tem...

Continue Reading

Conditional Ignore JUnit Test Rule

1. Overview In this tutorial, we'll examine how we can create a custom JUnit test rule to introduce new behavior to our tests. In the end, we'll ha...

Continue Reading

Verify Exceptions with JUnit

1. Overview In this tutorial, we'll look at different ways to verify exceptions in a JUnit test. 2. Verifying Exceptions using @Test Annotation Fir...

Continue Reading

Built-in JUnit Test Rules

1. Overview In this tutorial, we'll look at the built-in JUnit test rules. In the end, we'll have the knowledge to use them at appropriate places. ...

Continue Reading

Set Timeout for Tests with JUnit

1. Overview In this tutorial, we'll look at how we can set timeouts for unit tests using JUnit. 2. Set Timeout for a Single Test Firstly, let's see...

Continue Reading

Structure of JUnit Test Rule

1. Overview In this tutorial, we'll look at the basic structure of a JUnit test rule. 2. TestRule Interface The TestRule interface is the main inte...

Continue Reading

How to Ignore Properties Only For Serialization With Jackson

1. Overview In this tutorial, we're going to look at how we can ignore properties for serialization, but not for deserialization. So when Jackson i...

Continue Reading

Lombok @Data and @Value

1. Overview In this article, we'll look at the @Data and @Value annotations of Lombok. @Data and @Value are two shortcut annotations that bring a l...

Continue Reading

Lombok @AllArgsConstructor, @NoArgsConstructor and @RequiredArgsConstructor

1. Overview In this tutorial, we'll look at the Lombok @AllArgsConstructor, @NoArgsConstructor, and @RequiredArgsConstructor annotations. When we u...

Continue Reading

Lombok @Builder

1. Overview In this tutorial, we're going to look at the Lombok @Builder annotation to generate a builder for our class. It is a handy annotation e...

Continue Reading