Chapter-01 RestAssured

Imports explanation
1) Read the documentation for the API key and the endpoint urls here
2)Imports:
   > hamcrest: Matchers used for assertions e,g assertThat
   > @Test annotation from TestNG

 RestAssured provides a DSL(Domain specific language) in the form of given when then keywords. As we can see it starts with specifying the baseURL. Now the given block contains the setup of pre-requisites. Here we supply the parameters and headers for the api request.Now when is the action, which means what type of request we are dealing with GET POST PUT DELETE. We specify the endpoint here. This can be understood as resulting in concatenation of the baseURL and the resource path specified.In case of GET we supply 'param' and for POST it is queryParam. For more explanation read here.
.then() .Here the asasertions are specified. Multiple asserts are joined by .and()

next article store the response

Comments

Popular Posts