Create API Test Automation with REST Assured

What is REST-assured?

There are many ways to perform the REST assured API testing like using POSTMAN client, cURL, JMeter, SOAPUI. Apart from that, Java-based API test framework can be used (Apache HTTP Client, Jersey Test Framework and Rest assured).

Testing and validating REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain.

Example: This example for basicly usage of Rest Assured for your API Automation. We are trying to get some data from API response.

(GET) –>


"data": {
"id": 2,
"email": "",
"first_name": "Janet",
"last_name": "Weaver",
"avatar": ""
"ad": {
"company": "StatusCode Weekly",
"url": "",
"text": "A weekly newsletter focusing on software development, infrastructure, the server, performance, and the stack end of things."

Automation Script: We have learned how is dummy API working and responding manually. Now we are ready to automate this with Rest Assured. Finally we will add 3 test assertions (verifications). If any assertion fails, test will be marked as failed.

  • Response Status is 200 (successfull)
  • Body value equals to “”
  • Getting reponse less than 2 seconds.

        body("", equalTo("")).

You can read this tutorial “Quick Start with API Automation” to learn how to do it with MomentumSuite.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *