Added missing target

This commit is contained in:
Marcin Grzejszczak
2016-07-08 13:23:20 +02:00
parent 9a8c40f9e0
commit f8a46f966c
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
org.springframework.cloud.contract.spec.Contract.make {
request {
method 'POST'
url('/users') {
}
headers {
header 'Content-Type': 'application/json'
}
body '''{ "login" : "john", "name": "John The Contract" }'''
}
response {
status 200
headers {
header 'Location': '/users/john'
}
}
}

View File

@@ -0,0 +1,22 @@
{
"request" : {
"url" : "/users",
"method" : "POST",
"bodyPatterns" : [ {
"matchesJsonPath" : "$[?(@.login == 'john')]"
}, {
"matchesJsonPath" : "$[?(@.name == 'John The Contract')]"
} ],
"headers" : {
"Content-Type" : {
"equalTo" : "application/json"
}
}
},
"response" : {
"status" : 200,
"headers" : {
"Location" : "/users/john"
}
}
}