RestApi testing using Rest-Assured -


I'm new to the REST-Api test. I'm starting with a relaxing-API test for comfort-assurance. There is a problem in my first test case.

The code is as follows:

  public zero testGetSingleUser () {hopefully ()) statusCode (200). Equal ("Tim"), "last name", equal ("testarm"), "id", equal ("1") ("email", par ("test@hascode.com"), "first name" ("/ Service / single user");}   

In this code "Expect" ("Tim.") Command is not working I need to immediately fix this problem and move forward.

Your request can not compile Because you forgot () and you have to use equals () instead of equals ().

Try this request:

  given. (Hope). StatusCode (200) body ("email", equivalent ("test@hascode.com")) Body ("first name", equal ("tim"). Body ("last name", equal ("testarm"). Body ("id", equal ("1")) when received (). "/ Service / single user");   

Also double check your imports:

  imported static com.jayway.restassured.RestAssured.given; Static org.hamcrest.matchers.equalTo import;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -