Rest Assured Archives - james-willett.com

REST Assured Fundamentals Udemy

REST Assured Fundamentals: Udemy Course

By | Rest Assured | 2 Comments

This week I finally got round to releasing my first course on Udemy – REST Assured Fundamentals. I have been working on the course on and off over the past year, and I am very pleased that I have been able to finally release it to the public! The course took me quite a while to create, but I am really pleased with the output, and hope it can be…

Read More

REST Assured Schema Validation for JSON and XML

By | Rest Assured | No Comments

Another feature of REST Assured you will perhaps want to take advantage of is REST Assured Schema Validation. Implementing schema validation can be tricky if you aren’t familiar with the process. This post will walk you through setting up REST Assured Schema Validation for both JSON and XML. Not familiar with schema validation? It basically ensures that the JSON or XML response that you get back from an endpoint matches…

Read More
GPath Xml - Title Banner

How to Effectively use Groovy GPath in REST Assured – Part 3: GPath XML

By | Rest Assured | 3 Comments

  This post is the 3rd and final in the series on Groovy GPath in REST Assured, and will focus on GPath XML. View part 1 and part 2 in the series on GPath here. REST Assured uses XmlPath that can be queried with GPath expressions. XmlPath is an alternative to using XPath for easily getting values from an XML document.  A lot of the functionality and syntax that we…

Read More

How to Effectively use Groovy GPath in REST Assured – Part 2: GPath JSON

By | Rest Assured | 18 Comments

In part 1 of this series on how to effectively use Groovy GPath in REST Assured, we gave an overview of Groovy. We also covered installation options, the Groovy playground, and some of the basic concepts that will be useful to us for GPath in REST Assured. For part 2, we are going to focus purely on working with GPath JSON in REST Assured. Although XML continues to be widely used amongst APIs…

Read More

How to Effectively use Groovy GPath in REST Assured – Part 1: Overview of Groovy

By | Rest Assured | 8 Comments

Currently I am working on a video tutorial series for REST Assured. One of the topics that I will cover in-depth is how to use GPath in REST Assured properly. I figured I would publish a series of posts on my blog as a warm up to the topic. (Update: My REST Assured Fundamentals course is out now! See the link below for 80% off!) When working with REST Assured you…

Read More

Specification Re-use in Rest-Assured with ResponseSpecBuilder and RequestSpecBuilder

By | Automation, Rest Assured | 10 Comments

When you are writing tests against your API in Rest-Assured you might have some common expected results that you want to check every single time that you call the API. For example, look at the very simple test below: @Test public void testSomeApi() { when(). get(“http://yourWebsiteAddress.com/someAPIcall”). then(). statusCode(200). body(containsString(“Your Website Title”)); } What this test is doing is calling the ‘someAPIcall’ on ‘http://yourWebsiteAddress.com’ and then checking that the status code…

Read More

Going Further with Rest-Assured – Part 2: Parameterised Testing with JUnitParams

By | Automation, Rest Assured | 7 Comments

In part 1 of this series on Going Further with Rest-Assured, we looked at creating classes for our test data within our test code and then saw how we can put that data into a Java Map. We also took some example JSON and used Rest-Assured to create another Map of that data, so that we can compare the two. This post will follow on directly from the last one…

Read More

Going Further with Rest-Assured – Part 1: Writing and Using Test Data in your Framework

By | Automation, Rest Assured | 5 Comments

In the previous blog post we looked at how we can extract data from an API call directly into our tests using Rest-Assured and had a look at a couple of basic tests that we could execute against that data. One small issue with the previous post is that we did not have an actual API that we could use (unless you happened to have access to one), but I…

Read More