Spock httpd mock
My first attempt at writing a Spock extension. Jetty is used to set up a http server for unit testing. The first version of this plugin used NanoHTTPD as I thought that Jetty would be to slow for unit testing. It turns out that Jetty starts and stops a lot faster that I had thought!
Important: This is by no way stable yet. The code is still buggy as hell and important features are missing. At this point it's all about playing with Spock and trying to come up with the best possible API for testing HTTP / REST services.
src/test/groovy/spock/extension/httpdmock/examples for examples.
Roadmap / things to do
Improve error messages. I'm sure it's possible to make them a lot more helpful.
Add support for the typical rest convention
Support file uploading.
Write a Grails plugin
Try it out
Check out the sources and run
gradle test (you obviously need Gradle).
This is my first attempt at writing a Spock extension. If you know the answer to some of the questions above, or know of better ways of doing things then please let me know!