Wednesday, June 10, 2009

Hannibal makes Testing ReST easy

The Browser class in Hannibal makes testing ReSTful Web Services easy. Simply call get, put, post, delete, or options and pass in a url and if needed a parameter map. The code would look something like this:

var response = browser.delete(myUrlString)

browser.post(myUrlString, [parameterName: "someParameterValue"])

Then get the response from the web service call and make assertions. Take a look at the unit tests from our SvnServices project for more examples.

Look for more tips on using Hannibal in the future.

No comments:

Post a Comment