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 tutorial, I am going to share with you how to add H2 In-memory database support to your Spring Boot project which has Spring Security enabled. And at the end of this tutorial, you will find a video demonstration of how to do it. Once you do the below-described steps, your Spring Boot project…Read More Add H2 Database to Spring Boot Project with Spring Security
If your mobile or web app allows the user to register and have an account with your project then you also need to let users recover their lost or forgotten password. And in this video tutorial, I am going to share with you a few videos that will help you implement Password Reset functionality in your…Read More Password Reset in REST API. Video tutorial.
In this short tutorial, I am going to share with you how to enable CrossOrigin in a RESTful Web Service API built with Spring Boot, Spring MVC and which also has Spring Security enabled. Enable CrossOrigin for Specific Endpoint To enable cross origin AJAX HTTP request to a specific RESTful Web Service endpoint in our Rest Controller…Read More CrossOrigin and CORS in RESTful Web Service
In this tutorial, we will create a Spring Boot application which demonstrates how we can add and use the H2 in-memory database in our application. You will learn how an in-memory database like H2 can be used to develop a Spring boot application without an overhead of doing DB configuration on your machine and without…Read More Using H2 In-memory Database with Spring Boot
In this tutorial, we will build a Spring Boot application which demonstrates how to access data in a MongoDB database using the MongoTemplate APIs. For MongoDB, we will use mLab, which provides MongoDB Database as a Service platform so that you don’t even have to install a MongoDB database on your computer. Also, at…Read More Spring Boot and MongoTemplate Tutorial with MongoDB
In this REST Assured tutorial, you will learn how easy it is to test and validate RESTful APIs. REST Assured provides an excellent HTTP support, explicit verbs, and actions. We will use REST Assured in this tutorial, along with the Hamcrest library to perform assertions. REST Assured Maven Dependencies Before we start laying down examples for…Read More REST Assured Tutorial
In this Spring MVC tutorial, you will learn how to implement pagination in your RESTful Web Services app built with Spring MVC. The code example below will demonstrate how to implement pagination to implement “Get a list of users” registered with our app feature. I assume you already have your Spring MVC RESTful Web Service…Read More REST Pagination Tutorial with Spring MVC
In this Spring MVC tutorial, you will learn how to make your RESTful Web Service endpoint respond back with either XML or JSON representation. When the client application sends a request to our web service to get a Resource, like for example, User Details, it can provide a special HTTP Header that will request our…Read More Return XML or JSON in Spring MVC Web Service
In this Spring MVC tutorial, you will learn how to use @PutMapping annotation in your RESTful Web Services application to be able to accept HTTP Put request containing a Request Body with JSON or XML payload, so that you can perform let’s say an update user details operation. So, let’s say you want to send…Read More @PutMapping Example in Spring MVC
In this Spring MVC tutorial, you are going to learn how to use the @PostMapping annotation to make your RESTful Web Service Endpoint be able to handle HTTP Post request and read its JSON or XML body payload. Sending JSON in HTTP Post Request Let’s say we need to send the following JSON in our…Read More @PostMapping and @RequestBody Example in Spring MVC
In this Spring MVC tutorial, you will learn how to use the @RequestParam annotation to read the URL Query request parameters in your Spring MVC Web Services application. I am also including a video tutorial here so you can see it in action. Let’s assume we have the following URL to your Web Service endpoint.…Read More @RequestParam Example in Spring MVC
In this Spring MVC tutorial, you will learn how to use a @PathVariable parameter to read the path parameter value. I will also include here a video tutorial so you can see how to do it on video. Let’s say we have the following URL: http://localhost:8080/api/users/5jg8hf4ys9fit If we break the above URL down into smaller…Read More @PathVariable Example in Spring MVC
Almost in every RESTful Web Service application, I have to do the DTO to Entity and then Entity to DTO conversion. DTO stands for Data Transfer Object and is a simple Plain Old Java Object which contains class properties and getters and settings methods for accessing those properties. In this blog post, I am going…Read More DTO to Entity and Entity to DTO Conversion
With this Spring Boot tutorial, I am going to share with how to handle exceptions in your RESTful Web Service application build with Spring Boot. What If Exception Takes Place The good news is that if Exception takes place and your code does not handle it, Spring Boot will handle the Exception for you and will…Read More Handle Exceptions in Spring Boot RESTful Service