Adopting a structured approach for using Java classes to model responses makes verification easier. Learn how to convert your response into a Java construct.
- [Instructor] Just as we use Java classes … to model the body of an API request, … we can do the same for the body of a response. … This is known as deserializing. … Let's make a GET call to obtain a single product. … So we'll make a new Test, … and let's call this one getDeserializedProduct. … And we'll specify our endpoint. … And let's get right into the call, so we can say given. … And let's use a query parameter to specify the id. … So we'll say … given the id is, and let's just use 2, … we've used that product before. … Okay, now let's make the call. … So given this query parameter, … when, we say get … on this endpoint. … Now, usually, right here we would specify then, … and that would give us a response in a form … that would allow us to verify the body as JSON or XML. … However, in this chapter, … we want to get the response returned as a Java object. … So instead of calling then, … we're going to make a call to a method called as. … And inside of as, … you specify the Java classname …
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.