Add request headers validation
This commit is contained in:
parent
9670cd6d7e
commit
c97ce11837
6 changed files with 48 additions and 5 deletions
|
@ -28,7 +28,10 @@ class ContextExecutor {
|
|||
continue
|
||||
}
|
||||
}
|
||||
if (ex.requestMethod == mock.method && mock.predicate(xml)) {
|
||||
Map<String,String> headers = ex.requestHeaders.collectEntries { [it.key.toLowerCase(), it.value.join(',')] }
|
||||
if (ex.requestMethod == mock.method &&
|
||||
mock.predicate(xml) &&
|
||||
mock.requestHeaders(headers)) {
|
||||
println "Mock ${mock.name} invoked"
|
||||
++mock.counter
|
||||
String response = mock.responseOk(xml)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue