rest assured library methods code example

Example 1: what is rest assured library

A non-web service API that's BDD format and helps
integrate java code using deserialization and
serialization to extract data from the Json and
transform it into a java object in order to store,
verify, and validate the data to the expected one.

Example 2: rest assured script

The syntax of Rest Assured.io is the most beautiful part, as it is very
BDD like and understandable.

Given(). (lets you set a background)
		param("customer_id", "102").
        header("z", "w").
when(). (marks the premise of your scenario. For ex: get url)
Method(). (replace it with any of CRUD operations like get post put delete)
Then(). (your assert and matcher conditions goes here)
		statusCode(xxx).
        Body("x, "y", equalTo("z"));

Tags:

Java Example