Exception

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

With this Spring Boot tutorial, I will share how to handle exceptions in your RESTful Web Service application build with Spring Boot. Read the “Handling Exceptions in Project Reactor” tutorial if you use a project reactor. And to learn how to test your code for Exceptions, read the “Test for Exceptions with the JUnit” tutorial. What…

Read More Handle Exceptions in Spring Boot RESTful Service