Skip to content

Instantly share code, notes, and snippets.

@sebastienblanc
Created June 7, 2013 06:41
Show Gist options
  • Save sebastienblanc/5727443 to your computer and use it in GitHub Desktop.
Save sebastienblanc/5727443 to your computer and use it in GitHub Desktop.
given: "Application My App is about to be registered......"
def json = new JsonBuilder()
def request = testSpec.getRequestSpecification()
.contentType("application/json")
.header("Accept", "application/json")
.body(json {
name "MyApp"
description "awesome app"
}
)
when: "Application is registered"
def response = testSpec.getRequestSpecification().given().spec(request).post(root.toString() + "rest/applications")
//response.body().prettyPrint()
then: "Response code 200 is returned"
response.body().jsonPath().get("name") != null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment