Skip to content

Akashdeepkamboj/RestAssured

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RestAssured

JsonPath => JsonPath dependency is used to parse the json values. Query language that helps you to parsing the Json data which can be used for validation or assertion in a test.

eg. -> public void test_get2(){ String url =""; Response res = Restassured.given().get(url).andReturn(); res.getBody().prettyString(); asserTrue(response.getStatus == 200) Jsonpath js = new Jsonpath(res.toString); String result = js.get("result"); Sysout(result); }

Hamcrest Library Hamcrest is a framework that comes with the library of useful matchers for writing match rules using matcher objects. Matcher are mostly used for: Writing Test Assertion, Filtering, Data Validation

Specifications Specification helps us to make our code achive DRY(Dont Repeat Yourself) approcah If we are running multiple tests and some parameter of the request and response is same for all the testcases [Like Base URI and URL] then we can use Specification in order to avoid Duplicacy in our code.

There are two types of Specifications 1) RequestSpecification 2) ResponseSpecification

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published