How To Send Complex Payload As Object -POJO Serialization in Rest Assured

  Рет қаралды 47,265

Mukesh otwani

Mukesh otwani

Күн бұрын

Пікірлер: 89
@positivevibes1769
@positivevibes1769 3 жыл бұрын
Thank you so much, Mukesh for such a wonderful explanation about POJO
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thank you Dipali.. I am glad to you liked rest assured series.
@positivevibes1769
@positivevibes1769 3 жыл бұрын
@@Mukeshotwani yes I like it.. really superb
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
🙏
@saiganesh3629
@saiganesh3629 3 жыл бұрын
1:52 You said : 'Payload u r converting into object is Serialization. Reverse is Deserialization '. I think you've got confused here as that is Wrong. But, However this video title is still Correct , bcoz what's happening here is : Our Java Object POJO we're passing , which is getting converted to Payload and being sent to server. So Finally to avoid confusion for viewers, Object converted to payload/ Json file (which can then be passed over internet) = Serialization Json File/payload(which we get from internet) is converted back to a JavaObject= Deserialization. Nonetheless, This Playlist was so great. It actually gave me lot of clarity wrt RestAssured.
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thanks Ganesh
@sathishDoppalapudiSats
@sathishDoppalapudiSats Жыл бұрын
This is really good. Thank you very much for the detailed explanation and examples. Really appreciate your efforts
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Thank you so much Sathish I am glad it helped 🙏🏼
@theharshaankalgi
@theharshaankalgi 3 жыл бұрын
Last part you explained with diagram is where i understood. Thanks a lot Mukesh for all your effort. :3
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Most welcome 😊 Bhai
@souravmukherjee2497
@souravmukherjee2497 3 жыл бұрын
You r really putting some good amount of effort. A big Thank you!
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
So nice of you Saurav Thank you
@ravisinghrajpoot3086
@ravisinghrajpoot3086 4 жыл бұрын
Hi Mukesh.. Really appreciate for wonderful videos n passing ur expertise knowledge n making our lives at workplace easier... Can we implement multithreading as well in rest assured .. if yes how can v achive the same please guide n suggest..thanks in advance for all ur support...
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hey Ravi, I am glad my videos are helping you. You can achive multithreading using TestNG.
@ravisinghrajpoot3086
@ravisinghrajpoot3086 4 жыл бұрын
@@Mukeshotwani thanks for writing back..but you only answered first part of my question 😊🙏 please suggest how to achieve the same do you have any video on the same or any other suggestions
@ritwikchakraborty6327
@ritwikchakraborty6327 3 жыл бұрын
Hi Mukesh, Thank you for this Superb Explanation! You have shown how to serailize the Pojo object with ObjectMapper Class...but in 28.16(in Jira exapmle) you passed the Pojo objects only without serializing that and it is able to fetch the API response successfully? How did that happened here...just curious to know..! Dooes it mean serailization is optional when we are testing through RestAssured?
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Hi Ritwik, you can pass object, file, String etc while sending payload.Thank you so much for following the videos.
@chitranshsharma9764
@chitranshsharma9764 3 жыл бұрын
Hi Mukesh, you have done a great job , from the main purpose of me studying pojo was i want list type of attribute in pojo becuase the api which is sending me the json object is sending different no. of integers for example- it is sending how much work a user did today then tomorrow then next day..so i wanted to create a list..but i want to know when there is multiple json objects coming where this pojo is storing that..like in this example you shown there was one single json object ..but what is multiple json objects are coming
@sunandamohanty7204
@sunandamohanty7204 2 жыл бұрын
Awesome explanation Mukesh,finally i got the POJO concept .please add some more videos on frame work designing and extracting data from json(nested json array).
@Mukeshotwani
@Mukeshotwani 2 жыл бұрын
I will try my best Thanks Sunanda
@ramana223
@ramana223 5 жыл бұрын
Hi Mukesh, in createIssueJira class you have issuetype with value TASK and Project with value REST ,payload with value demo1 and demo description, then how in runtime your not getting the same in JSON response
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
I used separate project for this demo because I was using docker so I lost my old project.. you can use any project with any data.
@dibakardey6097
@dibakardey6097 4 жыл бұрын
@Mukesh what is the use of object mapper when we are passing the object reference in body for pojo...why do we need object mapper
@parkashram6482
@parkashram6482 4 жыл бұрын
If payload is very complex, should we need to go through this approach..or any other option we can use...
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Parkash, you can use Lambok for complex payload.
@parkashram6482
@parkashram6482 4 жыл бұрын
@@Mukeshotwani thanks Mukesh bhai it's very good library.
@soniyapachauri6862
@soniyapachauri6862 2 жыл бұрын
Superb Explanation, Complete list was helpful Thank you Mukesh :)
@Mukeshotwani
@Mukeshotwani 2 жыл бұрын
Glad you liked it Thank you Soniya
@soniyapachauri6862
@soniyapachauri6862 2 жыл бұрын
@@Mukeshotwani Please suggest how can we do same thing in AWS ?
@satyendras
@satyendras 3 жыл бұрын
Hi Mukesh, Good work as always. No question on your video, though I was just wondering as always its seems very easy with small sample API in tutorial, but when it comes to real implementation its not that easy. For ex as per your simple sample only we need to have 3-4 pojo classes, then think of a project where one needs to handle 100s of ( of course few of them may have more complex payloads with 50+ fields in there) APIs. Also its not easy to maintain this many pojo classes against changes where we have to add extra fields/nodes to json and remove few or change the values in there ..Can you please suggest any other approach if possible to deal my situation..? Thanks in Advance
@testautomation6742
@testautomation6742 3 жыл бұрын
Use String Manipulation it will be easy you can maintenance 100's field in minutes. Don't care payload is very complex or not.
@prafulanand6548
@prafulanand6548 4 жыл бұрын
If there are multiple complex responses do we need to create POJO classes like these for every response? Or is there any better approach
@testautomation6742
@testautomation6742 3 жыл бұрын
If you create API you have to do above explanation but if you will do TEST not need to do above. JSON payload is a String file. So you can use String Manipulation which is very easy with replace method.
@mahammadjabirsi7478
@mahammadjabirsi7478 3 жыл бұрын
Thanks Mukesh for this video, I have a doubt why we are writing getter and setter methods there, though we are not using it anywhere in the program.
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Yes we have used it.
@testcotesto2361
@testcotesto2361 4 жыл бұрын
Hi Mukesh, Thank you for great video. Its helpful. Could you please explain in the last part when you passed or copy pasted all different fields in JIRA class you did not use ObjectMapper?
@vibhavaripatil86
@vibhavaripatil86 Жыл бұрын
Thank you so much for this series...It is very useful...Can you please provide the code as well?
@AjayKumar-jm6pr
@AjayKumar-jm6pr 3 жыл бұрын
Awesome Explanation , Some good happens to you
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thank you Ajay bhai.
@harishkadambala8748
@harishkadambala8748 4 жыл бұрын
Hi mukesh, Can we do the same process using c# ?..if yes..can u please share the any relevant videos of c# ..In my current project we are using c#.net..thanks for the help
@ChethanCP
@ChethanCP 3 жыл бұрын
@mukesh what is the difference between pass payload as json file and the above approach? Is there any performance issue for json file as payload?? please clarify this
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Hi Chethan I have not seen any performance issue. We have different ways to send payload so depends on type of payload you can go with any of the approach. If you have static payload then take from file else pojo.
@ChethanCP
@ChethanCP 3 жыл бұрын
@@Mukeshotwani thank you
@John12685
@John12685 2 жыл бұрын
​@@Mukeshotwani No Jackson library required?
@whatthemad
@whatthemad 3 жыл бұрын
Hi Mukesh,What if we dont create payload class and name it as fields?
@manishsharma1834
@manishsharma1834 4 жыл бұрын
If we need to send bulk data to create bulk resources on the server using Rest assured, then which approach we should follow and how exactly it can be done. Please reply. thanks
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hey Manish, unfortunately rest assured does not have any method of this type so we need to take help of TestNG to do this. TestNG has dataProvider which run single test multiple times with different set of data. You can call same API multiple time with different set of data.
@Tidda420
@Tidda420 4 жыл бұрын
Hi Mukesh, will you please tell me difference between serialization and marshalling. what i know 1. We need a medium for communication between two APIs or two systems which can be JSON/XML/FILE/Plain text 2. For this communication we need to compress our object into stream of bytes e.g: POJO to JSON 3. This conversation is known as serialization 4. But there is also a term known as Marshalling where we convert java object to JSON , so I'm not able to differentiate in both, can you please help, pls differentiate marshalling and serialization
@avishekbehera
@avishekbehera 4 жыл бұрын
www.sololearn.com/Discuss/357962/what-is-the-difference-between-marshaling-and-serialization
@nandav529
@nandav529 5 жыл бұрын
can we use Hash map also inside pojo class if data is multiple of key values inside the name node ?
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Hi Nanda, yes we can use HashMap as well.
@nrravitej2498
@nrravitej2498 5 жыл бұрын
Hi mukesh, please post the link to the previous video where you have used the earlier code, i have just stared with this video. please
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Here is the link Tej kzbin.info/www/bejne/pmmUdXaYqrVlp80
@swathi_patel
@swathi_patel 2 жыл бұрын
I wanted to know how restassured calls work with TestNg, for example we have multiple restassured calls in the same @test annotation method I wanted to know which is calling first second like that
@yashsaxena47
@yashsaxena47 4 жыл бұрын
Nicely explained
@AlwaysAStranger
@AlwaysAStranger 2 жыл бұрын
When I convert POJO to JSON, it gets created in a different order. For example, I am expecting field1, field2, field3 { field4, field5, field6}, field7, field8 but I am getting it in field1, field2, field3, field87, field8, field3 { field4, field5, field6} order.
@pragnapal2498
@pragnapal2498 3 жыл бұрын
Need to know how do you create pojos for multiple json objects like a json array. Please share a tutorial for the same
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Hey Pragna, will try to create video on this too.
@royalblue585
@royalblue585 3 жыл бұрын
What if we have nested json loop in the payload. How can we create pojo classes of nested json...plzz reply
@karthic5231
@karthic5231 4 жыл бұрын
Can you post the video about how to use session filter and cookies filter to access existing session or cookies in two class access the same sessions for parallel test
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Yes Karthi will try to add..
@karthic5231
@karthic5231 4 жыл бұрын
Thanks ji..currently I send the request in JSON and get the session and set into context...but in test case rest assured we try to run in parellel is it possible to run in possible using session with rest assured
@raunakagnihotri126
@raunakagnihotri126 4 жыл бұрын
Awesome.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thank you! Cheers!
@pratapjavasingh3239
@pratapjavasingh3239 4 жыл бұрын
Then why we use @ json property here u only writing the model classes and and use object mapper classes convert in json that it serialization
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Sorry pratap, I did not get your question. Can you elaborate your question?
@pratapjavasingh3239
@pratapjavasingh3239 4 жыл бұрын
@@Mukeshotwani i want to know why we are using @json property in pojo like method levels setter and getter level
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
@@pratapjavasingh3239 if you watch video carefully there is one scenario when I dont have same keys for payload then I can use json property.
@pratapjavasingh3239
@pratapjavasingh3239 4 жыл бұрын
@@Mukeshotwani now I got it Thanks for the valueable response
@chethancp2010
@chethancp2010 3 жыл бұрын
Thanks a lot
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Most welcome Chethan
@sudarsantenneti
@sudarsantenneti 3 жыл бұрын
Mukesh, I need some support on creating a framework using RestAssured, will you able to provide? Can I have your number so I can speak to you or any other sources to support me..... thanks Does RestAssured supports binaries?
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Yes it supports binary response. Feel free to connect with me for any support mukeshotwani@learn-automation.com
@dibakardey6097
@dibakardey6097 4 жыл бұрын
Hey Mukesh How to pass the Json Array Values in Payload
@priyankshah4027
@priyankshah4027 5 жыл бұрын
There were couple of things which you can do, there is site which automatically generate pojos from Json. www.jsonschema2pojo.org/ Also you can use Lombok annotation processor which reduce boilerplate code.
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Thank you so much Priyank for www.jsonschema2pojo.org/. I will give a try for this. In our company they dont allow to use these site because of private data but it is very good for public data.
@muralic8259
@muralic8259 5 жыл бұрын
​@@Mukeshotwani , you can explore org.jsonschema2pojo api to convert json to pojo for your private data
@ashishkumarmishra2346
@ashishkumarmishra2346 4 жыл бұрын
How can we validate the id created??
@ashutoshpratapsingh6872
@ashutoshpratapsingh6872 4 жыл бұрын
Please create framework for this I'm waiting for that , thanks
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Yes Ashutosh will try to make videos soon on this.
@mayankmaheshwari6400
@mayankmaheshwari6400 3 жыл бұрын
Very very confusing. No where I could understand the concept. It was taught as if we need to learn on how to do this.
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Hey Mayank in order to understand this your java concept should be clear. Can you tell me which statement you could not understand.
@arvindramasamy966
@arvindramasamy966 4 жыл бұрын
Very Confusing
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Arvind what is the confusion?
@07majnon
@07majnon 4 жыл бұрын
How crpat bash64 payload
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Mate, can you share example?
Rest Assured | 42 | How to construct POJO for a complex json | தமிழ்
35:10
Learn Automation Online
Рет қаралды 2,2 М.
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 262 #shorts
00:20
#67. What is Serialization and Deserialization in Rest Assured?
21:09
Retarget Common
Рет қаралды 6 М.
37. Create Complex JSON Payload Using Java For Rest Assured
29:01
Retarget Common
Рет қаралды 14 М.
What is a POJO in Java? Almost EVERYONE Gets This Wrong
5:05
Coding with John
Рет қаралды 122 М.
Serialization and DeSerialization in Rest Assured
22:51
Testers Talk
Рет қаралды 1,2 М.
How to Handle Authentication in RestAssured
17:00
Mukesh otwani
Рет қаралды 48 М.
How to Perform Post, Delete, Put Method in Rest Assured- API Testing-
32:12
Luminous screen protectors 🔥 #iphone ##screenprotector #android
0:19
Новый MacBook Air M2 разрядился в коробке!
1:00
Какой XIAOMI Купить в 2024-2025 году
14:03
Thebox - о технике и гаджетах
Рет қаралды 113 М.
Tool ltems magic ✨ please try it 🤯 #smartphone #automobile #gadgets #shorts
0:19
លីណាឆ្នោតយួន 168
Рет қаралды 910 М.