...

/

Serialization and Deserialization

Serialization and Deserialization

In this lesson, we will see what serialization and deserialization of requests is.

What is serialization?

Serialization is the process of converting objects into a stream of data.

What is deserialization?

Deserialization is the process of converting a stream of data into objects.

The main purpose of serialization and deserialization is to persist the data and recreate it whenever needed.

We have considered the Rest Assured library for making REST API calls. We will keep the scope within those capabilities of Rest Assured and the libraries it depends on.

As we keep learning about REST API automation and the data that is exchanged between client and server is of JSON format, we will learn how to serialize objects into a stream of JSON data and deserialize stream of data to objects that are exchanged between the REST web service.

Rest Assured can use the Jackson 2 library, GSON library or Jackson library for serialization and deserialization. The internal behavior of io.restassured.mapper.ObjectMapper is dependent on the library in the classpath.

Sample data for demonstration & understanding the data

We will use the Jackson 2 library for serialization and deserialization purposes, for which we will ensure the following dependency from ...