Skip to content
Advertisement

How to load json data in java?

I’m quite new to API testing, I am wondering how to best and simple load some body? I created simple pojo classes, but i am having problems with nested json. ex:

JavaScript

Then, in classes I used:

JavaScript

and

JavaScript

then in test class I am trying to use it, but have no idea how.

JavaScript

But I have no idea how to declare those 4 properties (name, value)

Advertisement

Answer

You are actually on a pretty good track, you can use Gson library to help you out, Here is the video example for your explanation which I used to learn Gson back when I needed it

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement