Rest Assured API for Rest Service Integration testing

We use Rest Assured Api for testing the Rest services. Its very easy to implement. It works based on Given when then approach

public class RestAssuredTest{
    public void setUp() {
        RestAssured.baseURI = "http://localhost"; //Domain name
        RestAssured.port = 8080; //port number
        RestAssured.basePath = "/api/"; //Service Base URL

    public void testRestService() {
        Response res = given().param("QUERY_PARAM", "QUERY_VALUE").get("REST SERVICE PATH");
        assertEquals(200, res.getStatusCode());

Please refer my another posts for more information Rest Assured – Example and Rest Assured – Test Secure web services


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s