Don't leave rest-assured footprint in your script!

Sajitha Pathirana
3 min readFeb 3, 2022

I thought it would be the best time to talk about API Testing since API testing is widely adopted and the good proof is API test automation is advertised in almost every job role related to Test Automation Engineer.

Photo by Evie S. on Unsplash

Rest-Assured is the most commonly used library in java for API testing. Generally, we use rest-assured commands and develop our scripts. However, with my experience, this is offering challenges in terms of maintainability.

Especially, when there is a version upgrade in rest-assured, and if the APIs have been changed, you will have a deadlock, you need to upgrade the version, and once you upgrade you will have compilation errors in your 1000+ scripts.

In order to avoid that, it is worth developing a framework wrapped with vanilla rest-assured commands.

Here in this article, I am sharing a context-driven approach to develop an API test automation framework with rest-assured.

Let’s first look at the advantages of this approach.

  • When you are exposing a wrapped command to your script layer, you have control and avoid direct use of APIs from third-party libraries.
  • Therefore, at anytime you can change the underline technology, without impacting the script layer with 1000+ scripts. You need to update…

--

--

Sajitha Pathirana

A Test automation enthusiast, passionate to help the teams to enhance their testing journey with his decade of experience in the field.