API Automation using REST Assured and JUnit -1

With the ever-increasing use of the internet and the advent of Cloud transformation, REST APIs as the backbone of all Web and Cloud development have become paramount. What has grown along with this is the need of skilled testing professionals and amazing automation frameworks to perform efficient testing of these APIs. There is a huge list of open source technologies for example: — Jersey and Springboot that help developers implement these APIs with the greatest of ease and flexibility. The challenge that testing team faces over here is to have an API testing framework that is good enough in terms of scalability and efficiency to test these APIs including all the corner scenarios.

This challenge is further compounded with the advent of microservices architecture. Here the entire application is broken down into smaller loosely coupled units and the intercommunication between the services and between the services and clients take place using REST services due to their lightweight nature. Each service’s individual functionality and internal implementation is completely opaque to another service while all these microservices are part of the same application. These applications may be deployed in Cloud environments like AWS Lambda, ECS or Microsoft Azure. So, we can imagine how complex this equation gets and how much more challenging it becomes to test these applications. While the stages of microservices application testing have many more layers of testing starting from unit testing to UI/Functional testing. I will be discussing about having a REST API automation framework to begin with.

To keep things simple, the framework is written in JAVA using maven project structure and the below list of libraries: -

> Rest Assured

> JUnit

Here is the starter code for your reference. The github link is —


Above is the basic block diagram of the framework. I will be walking over the code in my next article. Till then please feel free to post any questions or suggestions for improvements and I will be making sure I take those into account before my next post to my best.

We are a software testing services company. Our team provides dedicated support for all types of testing services starting from project planning to execution. Please visit our website https://www.maaitc.com/

Linkedin — https://www.linkedin.com/in/pandeypriyadarshani/

Software QA and Development Professional with over 11 years of experience. Writer and technophile.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store