Table of Contents
What we have learned so far?
https://www.onlyfullstack.com/what-is-rest-assured-how-to-setup-rest-assured/
Sample Rest API to do Testing for Rest Assured
In this post we will explore the rest api which we will be using through out this tutorial to learn the Rest API automation. We have created the rest api of employee where we can get the details of an employee, save an employee, update an employee and delete an employee. Please follow below steps to start and use this rest api application on your system.
1. Clone the below repository
git clone https://github.com/onlyfullstack/rest-assured-tutorial.git
This will clone th repository in your local system.
Repository Link – https://github.com/onlyfullstack/rest-assured-tutorial
mvn spring-boot:run
You can download the postman from below link –
https://www.postman.com/downloads/
Import the postman collection as below
Go to File -> Import -> Choose Files and navigate to rest-assured-tutorial/ and select OnlyFullStack_Employee.postman_collection.json collection file.
https://github.com/onlyfullstack/rest-assured-tutorial/blob/master/OnlyFullStack_Employee.postman_collection.json
Now go to your postman and hit the requests as you wish.
HTTP Method
|
Request Name
|
Description
|
GET
|
Get All Employees
|
Get All Employees from the database
|
GET
|
Get Employee
|
Get an Employees from employee id
|
POST
|
Save Employee
|
Saves new Employee into database
|
PUT
|
Update Employee
|
Updates an Employee into database
|
DELETE
|
Delete Employee
|
Deletes an Employee from database
|
Get All Employees
Get Employee
Save Employee
Update Employee
Delete Employee
Try the employee api form postman and perform all 5 operations as we are going to automate the api testing with Rest Assured.
Lets go to our next tutorial where we will discuss below points :
Part 3 – How to make a GET Request using Rest Assured
– What is HTTP?
– What are different types of HTTP method?
– What is GET? How to make get request in Rest Assured?
– Rest assured get api automation without BDD approach
– Rest assured get api automation with BDD approach
https://www.onlyfullstack.com/how-to-send-get-request-in-rest-assured/
Source Code
You can find the complete source code on below GitHub repository –
https://github.com/onlyfullstack/rest-assured-tutorial
Rest Assured Tutorial
https://www.onlyfullstack.com/rest-assured-tutorial-for-beginners/