Guide to ReflectionTestUtils for Unit Testing Spring Testing 1. Introduction ReflectionTestUtils is a part of Spring Test Context framework. It is a collection for reflection-based utility methods used in a unit, and integration testing scenarios to set the non-public fields, invoke non-public methods, and inject dependencies. In this tutorial, we’ll take… Continue Reading spring-reflection-test-utils

Introduction to JSONassert 1. Overview In this article, we’ll have a look at the JSONAssert library – a library focused on understanding JSON data and writing complex JUnit tests using that data. 2. Maven Dependency First, let’s add the Maven dependency: <dependency> <groupId>org.skyscreamer</groupId> <artifactId>jsonassert</artifactId> <version>1.5.0</version> </dependency> Please check out the… Continue Reading jsonassert

REST-assured Support for Spring MockMvc 1. Introduction In this tutorial, we’re going to learn how to test our Spring REST Controllers using RestAssuredMockMvc, a REST-assured API built on top of Spring’s MockMvc. First, we’ll examine the different setup options. Then, we’ll dive into how to write both unit and integration… Continue Reading spring-mock-mvc-rest-assured