A Groovy framework for functional testing rest services. Intended to help you relax while you REST.
Note: Please review the tests for a comprehensive look at the usage.
new Tea('http://httpbin.org')
.get('/get')
.expectStatus(200)
.verifyResponse { json ->
assert "http://httpbin.org/get" == json.url
}
.brew()
new Tea('http://httpbin.org')
.post('/post', ["name":"Value"])
.expectStatus(200)
.verifyResponse { json ->
assert json.json.name == "Value"
}
.brew()
new Tea('http://httpbin.org')
.put("/put", ["name":"Value"])
.expectStatus(200)
.verifyResponse { json ->
assert json.json.name == "Value"
}
.brew()
new Tea('http://httpbin.org')
.delete("/delete", ["$expectedKey":expectedValue])
.expectStatus(200)
.verifyResponse { json ->
assert expectedValue == json.args."$expectedKey"
}
.brew()
Green-Tea-Test is deployed to Maven Central Repository
testCompile group: 'com.greenmoonsoftware', name: 'green-tea-test', version: '1.0.5'
Contributions are welcome. Simply do the following:
git clone https://github.com/greathouse/green-tea-test.git
./gradlew test
Copyright © 2015 Robert Greathouse http://www.greenmoonsoftware.com/ This project is licensed under The Apache Software License, Version 2.0.