Isolating bugs with REST services

I describe a library that helps testers and devs isolate bugs found with REST-assured.

REST-assured is a popular Java library that makes testing REST services easier. For the last few months we have used it to automate tests for a complex authentication flow. Large part of tests consisted of multiple REST calls, checking system behaviour in different states. Finding bugs was one challenge but reproducing them was another. Particularly, we struggled with:

  • Bug isolation. You’re trying to isolate a bug you found in a long test with REST-assured but you don’t want to replay whole scenario over and over. You just want to replay one step and see a HTTP response.
  • Pair debugging. Together with a dev you’re debugging a bug. She’s putting breakpoints in her code and asking you to replay your REST-assured test over and over because she does not have downloaded it yet.
  • Bug reporting. A bug you have found must be reported in a bug tracking system and you need to quickly describe steps to reproduce it. While for UI it is often fairly easy to list clicks and choices, for a backend system describing API calls is harder.

All those problems can be addressed with cURL. cURL is a popular command line tool available for many platforms and with many *nix distributions it comes pre-installed, so a dev can easily reproduce an issue. Initially, I was crafting those curl commands manually but this scaled poorly. Other platforms for testing offer automatic generation of curl commands from HTTP requests (Chrome Developer Tools, Postman add-on for Chrome, Firebug add-on for Firefox, Ok2Http client), but REST-assured was missing that.

So I’ve created a small library, curl-logger.

How does it work?

Imagine you’re trying to send HTTP GET request to with REST-assured:


curl-logger will log it as the following curl command:

[code lang=text]
curl '' -H 'Accept: */*' -H 'Content-Length: 0' -H 'Host:' -H 'Connection: Keep-Alive' -H 'User-Agent: Apache-HttpClient/4.5.1 (Java/1.8.0_45)' –compressed –insecure –verbose

You will find more details how to setup a library on the project page.

Waiting for your feedback

The library generates curl commands from an actual request rather then only request specification you wrote, so if a HTTP client in your test accepted server cookies, they will be included by curl-logger as well. Currently, the library supports multiple HTTP methods, multipart/form and multipart/mixed content types and handles file attachments.

If you find it useful, encounter a bug or miss a feature, let me know.

7 Comments for “Isolating bugs with REST services”

Raveendar Reddy


Hi Maciej Gawinecki,
It’s a nice post.
Earlier we tried to automate REST services using REST-assured but later one of my team mate found a framework to automate REST and SOAP services.
I saw your comments in StackOverFlow against this Karate framework. Is it good to go ahead with Karate framework. Did you find any cons in that framework.We are still in early phase of REST automation. So it would be useful for us if there is any advantage over REST-Assured.Because my manager also said Ok to use Karate framework as there is flexibility to write code less tests.
Could you please suggest which one is best.?

Maciej Gawinecki


Hi Reddy. Thanks for your question. I don’t have any experience with Karate framework. I have experience working with REST-assured and Retrofit libraries. I use both because each have advantages in specific scenarios. For instance, REST-assured is very good if you want to manipulate each HTTP header precisely, while Retrofit requires less code in tests and is easier to read, but does not allow for headers manipulations. If I were you I would spend 1 or 2 days to write same REST and SOAP test in both REST-assured and Karate. This way you will see if it is good for your scenarios. Good luck!



Hi, i’ve just tried implement your library in my code, and i have problems

compile group: ‘com.github.dzieciou.testing’, name: ‘curl-logger’, version: ‘1.0.3’

Did i forget about something or library currently is not working?

And anyway, great job 😉

Leave a Reply

Your email address will not be published. Required fields are marked *