Compare your solution to the model answer to test your knowledge of API responses.
(upbeat music) … - [Instructor] How'd you do? … Let's walk through the solution of verifying the response … to this get product request. … First, we create a new method. … And inside of this method, … we declare the endpoint, which is read one. … And then we say, given the ID is 18, … when we make a get request … to this read one endpoint, then we can assert that. … And now we want to assert the three parts of the response, … starting with the status code, which should be 200, … meaning the get request was successful. … Next, we want to make sure that the data was returned … to us in JSON format. … So we verify that the content type header … has a value of application JSON. … Then the final part of the response is the body. … And the challenge was to verify each of its fields. … These can be verified in any order, … as long as there's an assertion for each one. … The ID should be 18. … The name should be equal to multivitamins, 90 capsules. … And if you use the matcher to verify partial text here, …
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.