/rest-assured-examples

Learn API testing using rest-assured framework.

Primary LanguageJavaApache License 2.0Apache-2.0

Java CI with Maven Open Source Love License

Don't forget to give a ⭐ to make the project popular.

❓ What is this Repository about?

This project is the outcome of my self-learning about the API Testing Automation framework - Rest-assured. I heard a lot about Rest-Assured and how it made the QA's life easier by helping them to run all the tedious API tests in an efficient way. Hence, I started learning about the framework and have documented all my learnings in this repository with all example code from writing basic tests to running end to end API automation tests.

💼 What does this repo contain?

  • This repo contains example codes of API Tests using Rest-Assured.
  • Hamcrest Matchers are used for assertions.
  • TestNG Listeners are used to capture the events in logs.
  • Log4j is used to capture logs.
  • Lombok has been used to generate Getter and Setters automatically for post body requests.
  • FAKE Rest APIs on Reqres.in has been used for testing.
  • End to End scenarios have been added for the restful booker APIs.

🛠️ Talking more about the Scenarios Covered in this project:

You will get the answers to the following questions and its respective working code example with rest-assured framework in this repository:

  • How to write tests for Get requests?
  • How to write tests for POST requests?
  • How to write tests for PUT requests?
  • How to write tests for PATCH requests?
  • How to write tests for DELETE requests?
  • How to handle the authentication requests?
  • How to write tests for SOAP API requests?
  • How to verify the Response Body?
  • How to verify the Response Status Code?
  • How to verify the Response headers?
  • How to extract value from Response Body?
  • How to perform assertions using Hamcrest Matchers?
  • How to create POJO for passing values to request body?
  • How to use Lombok to generate Getters and Setters?
  • How to use Lombok for writing the builder pattern code?
  • How to use Builder Pattern for test data generation using Java Faker?
  • How to write end-to-end api tests?
  • How to perform JSON Schema Validation?

✍️ Blog Links

❓ Need Assistance?

  • Discuss your queries by writing to me @ mohammadfaisalkhatri@gmail.com OR ping me on any of the social media sites using the below link:

💻 Paid Trainings

Contact me for Paid trainings related to Test Automation and Software Testing, mail me @ mohammadfaisalkhatri@gmail.com or ping me on LinkedIn

💭 Checkout the blogs related to Testing on my website