Test

In this tutorial, you will learn how to write a JUnit Test that validates if the method under the test throws the correct exception. This tutorial will have examples for JUnit 5 and JUnit 4 as well. Let’s begin with JUnit 5 version first. JUnit 5. “assertThrows()” Assertion To test for exceptions in JUnit 5…

Read More Test for Exception in JUnit 5 and JUnit 4

In this JUnit 5 and Rest Assured tutorial, I am going to share with you how to add JUnit 5 and Rest Assured support to your Spring Boot project. It will be more than that actually. This tutorial will cover: Add JUnit 5 and Rest Assured to Spring Boot Project, Create a new JUnit 5…

Read More Create a JUnit 5 Test Case with Rest Assured. Video Tutorial.

In this REST Assured tutorial, I am going to share with you how to evaluate the JSON content returned in the Response Body of HTTP Response. JSON Content Returned in Response Body Let’s say we have a RESTful Web Service endpoint that returns user details of the following structure: { “userId”: “Y3vWa8QwjK0DW6NmvB4HsXIV9gHg1q”, “firstName”: “Sergey”, “lastName”:…

Read More REST Assured Evaluate JSON Response Body