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…

In this short tutorial, I am going to share with you how to enable CrossOrigin in a RESTful Web Service API build with Spring Boot and Spring MVC. And to do that you need to simply annotate a method in your RestController class with @CrossOrigin annotation like in the example below. Enable CrossOrigin @CrossOrigin(origins = “http://localhost:8080”) @GetMapping(path =…

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…

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”:…

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…

In this REST Assured tutorial, you will learn how to make HTTP Post request and validate the Response. To break it into more details you will learn: Make HTTP Post request with REST Assured, Create JSON Object using the com.google.gson library, Send JSON payload in the body of HTTP Post request, Validate the Response To be…

In this tutorial, you are going to learn how to get HTTP Header value from HTTP Response when testing your RESTful API with REST Assured. Let’s assume that we have configured Spring Security in our RESTful Web Services application and now we have the following Web Service Endpoint which acts as a user Authentication endpoint.…

In this short Java tutorial, you will learn how to quickly generate a serialVersionUID for a given class. Most Java IDEs provide a support for generating serialVersionUID automatically while some require you to install a plugin for you to generate this value. Generate SerialVersionUID for a Java Class There is a built-in command in JDK…

In this short REST Assured tutorial, you will learn how to validate HTTP Response Status Code when testing RESTful Web Service endpoint. Every HTTP Response has a status code and depending on the status code value we can determine if HTTP Response was successful or not. Let’s have a look at how we can validate…

In this short tutorial on REST Assured you will learn how to get the entire HTTP Response Body when testing your RESTful Web Service Endpoint. Web Service Endpoint Response Let’s assume we have the following Web Service Endpoint URL and when HTTP GET request is made to this Web Service Endpoint a JSON representation of…

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…

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…

In this Spring MVC tutorial, you will learn how to make your RESTful Web Service endpoint respond back with either XML or JSON representation. To make your Web Service endpoint be able to respond with either XML or JSON representation include MediaType.APPLICATION_JSON_VALUE and MediaType.APPLICATION_XML_VALUE media types into the RequestMapping annotation of your resource method. For example: @GetMapping(path…

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…

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 quest 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…