Lombok @Log4j, @Slf4j and Other Log Annotations

1. Overview In this tutorial, we're going to examine Lombok log annotations like @Slf4j, @Log4j or @Log. 2. Use Log Annotations Lombok provides sev...

Continue Reading

Lombok @SneakyThrows

1. Overview In this tutorial, we'll look at the Lombok @SneakyThrows annotation. 2. Maven Dependency We'll first add the Lombok maven dependency: <...

Continue Reading

Create Mocks using Mockito

1. Overview In this tutorial, we're going to look at different ways to create mock objects using Mockito. Mockito provides specific annotations to ...

Continue Reading

Define Multiple Expectations using Mockito

1. Overview In this tutorial, we're going to look at defining multiple expectations on a mock. Generally, we configure a method on the mock object ...

Continue Reading

Override Expectations using Mockito

1. Overview Mockito allows us to define expectations on mock objects. Additionally, we generally must reconfigure mock objects on different test me...

Continue Reading

Return Custom Value using Mockito

1. Overview In this tutorial, we'll explore different ways to return custom values from mocked methods. For this purpose, Mockito provides the Answ...

Continue Reading

Return Given Arguments using Mockito

1. Overview In this tutorial, we'll look at how we can return an argument that is passed to the mocked method. For this purpose, we'll use Mockito'...

Continue Reading

Capture Arguments with ArgumentCaptor

1. Overview In this tutorial, we'll investigate how to capture method arguments on the mocked methods using Mockito. For this purpose, we'll use th...

Continue Reading

Change Property Name With Jackson

1. Overview In this tutorial, we'll look at changing property names during serialization and deserialization. As a result, a field name in Java obj...

Continue Reading

Formatting Date For Serialization using Jackson

1. Overview In this tutorial, we'll investigate how to format date fields for serialization using Jackson. Firstly, we'll look at Jackson's default...

Continue Reading