I have got some rest API's for testing with rest assured.

How to automate using with rest assured? What are the different cases that I need to test?

This is a sample API. What are the test cases that I need to test? I want to know about rest API testing concept.

Here is the sample API, what should I do?

appinit (GET)



Here is a sample API testing:

    package  com.qber.test;

    import org.testng.annotations.DataProvider;
    import org.testng.annotations.Test;

    import static com.jayway.restassured.RestAssured.given;
    import static org.hamcrest.CoreMatchers.equalTo;

   public class bookToken {
    @Test(dataProvider = "appinit")
    public void md5JsonTest(String clientId,String appName)

                parameters("c", clientId).parameters("a",appNmae).
                body("md5", equalTo(md5Hash));

    @DataProvider(name = "appinit")
    public Object[][] createMD5TestData() {

        return new String[][] {



What are the additional test cases that I should write?

2 Answers 2


In terms of more cases that you need to test, here are some examples:

  • get with an invalid client-id, expect error
  • get with empty app-name, expect error
  • get without passing any query string parameters
  • validate that the md5 hash returned is as expected
  • validate the payload, that it has 'status' and 'dt' as not-null
  • validate the format of the payload data (if it is a string or valid date etc)

I recommend Karate for testing, it is much simpler than REST-Assured. (disclaimer: I am the dev)


If you considering automating API's, I would suggest you to automate it in a traditional way using either

  1. Java HttpURLConnection
  2. Apache HttpClient

Please take a look at this link for more info on above 2 points.

  • I edit my post please review Feb 17, 2017 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.