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

Поделиться
HTML-код
  • Опубликовано: 26 янв 2025

Комментарии • 89

  • @positivevibes1769
    @positivevibes1769 3 года назад +2

    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 года назад +1

      @@Mukeshotwani yes I like it.. really superb

    • @Mukeshotwani
      @Mukeshotwani  3 года назад

      🙏

  • @saiganesh3629
    @saiganesh3629 3 года назад +4

    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.

  • @souravmukherjee2497
    @souravmukherjee2497 4 года назад +2

    You r really putting some good amount of effort. A big Thank you!

  • @theharshaankalgi
    @theharshaankalgi 4 года назад +1

    Last part you explained with diagram is where i understood. Thanks a lot Mukesh for all your effort. :3

  • @sathishDoppalapudiSats
    @sathishDoppalapudiSats Год назад +1

    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 🙏🏼

  • @dibakardey6097
    @dibakardey6097 4 года назад +2

    @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

  • @soniyapachauri6862
    @soniyapachauri6862 3 года назад +1

    Superb Explanation, Complete list was helpful Thank you Mukesh :)

    • @Mukeshotwani
      @Mukeshotwani  3 года назад +1

      Glad you liked it Thank you Soniya

    • @soniyapachauri6862
      @soniyapachauri6862 3 года назад

      @@Mukeshotwani Please suggest how can we do same thing in AWS ?

  • @ramana223
    @ramana223 5 лет назад +3

    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 лет назад +1

      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.

  • @parkashram6482
    @parkashram6482 4 года назад +3

    If payload is very complex, should we need to go through this approach..or any other option we can use...

    • @Mukeshotwani
      @Mukeshotwani  4 года назад +1

      Hi Parkash, you can use Lambok for complex payload.

    • @parkashram6482
      @parkashram6482 4 года назад

      @@Mukeshotwani thanks Mukesh bhai it's very good library.

  • @AjayKumar-jm6pr
    @AjayKumar-jm6pr 4 года назад +1

    Awesome Explanation , Some good happens to you

  • @nandav529
    @nandav529 5 лет назад +1

    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.

  • @prafulanand6548
    @prafulanand6548 5 лет назад +1

    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.

  • @sunandamohanty7204
    @sunandamohanty7204 2 года назад +1

    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

  • @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

  • @ChethanCP
    @ChethanCP 3 года назад +1

    @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 года назад +1

      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?

  • @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

  • @manishsharma1834
    @manishsharma1834 4 года назад +1

    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 года назад +2

      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.

  • @ravisinghrajpoot3086
    @ravisinghrajpoot3086 4 года назад +1

    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 года назад +1

      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

  • @mahammadjabirsi7478
    @mahammadjabirsi7478 3 года назад +1

    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.

  • @royalblue585
    @royalblue585 3 года назад

    What if we have nested json loop in the payload. How can we create pojo classes of nested json...plzz reply

  • @satyendras
    @satyendras 3 года назад +1

    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.

  • @nrravitej2498
    @nrravitej2498 5 лет назад +1

    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 ruclips.net/video/p81DCbuP2qk/видео.html

  • @ritwikchakraborty6327
    @ritwikchakraborty6327 3 года назад +1

    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 года назад +1

      Hi Ritwik, you can pass object, file, String etc while sending payload.Thank you so much for following the videos.

  • @vibhavaripatil86
    @vibhavaripatil86 2 года назад

    Thank you so much for this series...It is very useful...Can you please provide the code as well?

  • @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?

  • @pragnapal2498
    @pragnapal2498 3 года назад +1

    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 года назад +1

      Hey Pragna, will try to create video on this too.

  • @karthic5231
    @karthic5231 4 года назад +1

    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 года назад +1

      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

  • @ashishkumarmishra2346
    @ashishkumarmishra2346 4 года назад

    How can we validate the id created??

  • @pratapjavasingh3239
    @pratapjavasingh3239 4 года назад +3

    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 года назад +1

      Sorry pratap, I did not get your question. Can you elaborate your question?

    • @pratapjavasingh3239
      @pratapjavasingh3239 4 года назад +1

      @@Mukeshotwani i want to know why we are using @json property in pojo like method levels setter and getter level

    • @Mukeshotwani
      @Mukeshotwani  4 года назад +1

      @@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 года назад +1

      @@Mukeshotwani now I got it Thanks for the valueable response

  • @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

  • @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.

  • @dibakardey6097
    @dibakardey6097 4 года назад

    Hey Mukesh How to pass the Json Array Values in Payload

  • @Baigan42
    @Baigan42 4 года назад +1

    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

  • @yashsaxena47
    @yashsaxena47 5 лет назад

    Nicely explained

  • @sudarsantenneti
    @sudarsantenneti 4 года назад +1

    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  4 года назад

      Yes it supports binary response. Feel free to connect with me for any support mukeshotwani@learn-automation.com

  • @ashutoshpratapsingh6872
    @ashutoshpratapsingh6872 4 года назад +1

    Please create framework for this I'm waiting for that , thanks

    • @Mukeshotwani
      @Mukeshotwani  4 года назад

      Yes Ashutosh will try to make videos soon on this.

  • @raunakagnihotri126
    @raunakagnihotri126 4 года назад +1

    Awesome.

  • @priyankshah4027
    @priyankshah4027 5 лет назад +1

    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 лет назад +1

      ​@@Mukeshotwani , you can explore
      org.jsonschema2pojo
      api to convert json to pojo for your private data

  • @chethancp2010
    @chethancp2010 4 года назад

    Thanks a lot

  • @mayankmaheshwari6400
    @mayankmaheshwari6400 4 года назад +2

    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  4 года назад

      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 года назад +2

    Very Confusing

    • @Mukeshotwani
      @Mukeshotwani  4 года назад

      Hi Arvind what is the confusion?

  • @07majnon
    @07majnon 4 года назад +1

    How crpat bash64 payload