Learn a structured approach for using Java classes to model data that needs to be sent as part of a request. This is a more efficient way of programmatically sending request data.
- [Instructor] When creating large bodies … as part of a request, … having a huge text block in your code may not be ideal. … You can define this data in a more structured way … by serializing it as part of a Java class. … Let's create a new package, … and we'll call this package Models. … And under the Models package, we'll create a new Java class, … and we'll call this one Product. … Now this Product class will represent … a serialized object form of the request body. … So in order to do that, … we're going to need to include the fields … that are represented in the request. … So let's go ahead and make those fields. … We can make an ID. … We know that we need the name of the product. … We need a description. … We need a price. … And we need the category ID. … It's really important to name these variables … exactly as they're named in the API, … because this is how it will bind our variable … with the respective API body field. … Okay, let's go ahead and generate some getters … and setters for each of these, …
Skill Level Intermediate
API setup3m 46s
1. Getting Started with REST Assured
REST Assured testing library3m 29s
2. Making API Requests
3. Validating API Responses
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.