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)
=======
http://th/m/v2/appinit?
clientId=3&
appName=qberCli
{
"status":true,
"app_secret":"c6b8fff7accd0daf75f1c5757ce11",
"dt":1486100177
}
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)
{
given().
parameters("c", clientId).parameters("a",appNmae).
when().
get("http://th/m/v2/appinit?
clientId=&
appName=").
then().
assertThat().
body("md5", equalTo(md5Hash));
}
@DataProvider(name = "appinit")
public Object[][] createMD5TestData() {
return new String[][] {
{"3","qbercli"}
};
}
}
What are the additional test cases that I should write?