How does REST Assured determine how to process an API response if you don’t tell it how to do so explicitly code example
Example 1: why need rest assured
Imagine you open your google map view and look for a place you want to go,
you immediately see closeby restaurants, you see options for the commute;
from some leading travel providers, and see so many options at your
fingertips. We all know they are not google products but google manage to
show it. They use the exposed APIs of these providers.
Even before the UI built or under development, API testing becomes very
important, we are testing them repeadetly with different data combinations
makes it a very suitable case for automation.
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"));