Skip to content

Commit

Permalink
added the missing matcher for eachKey in Groovy DSL #313
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Sep 15, 2016
1 parent 528e9a1 commit b449675
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ class PactBodyBuilder extends BaseBuilder {
}
}
} else if (value instanceof Closure) {
if (matcherName == STAR) {
setMatcherAttribute(new TypeMatcher(values: [TYPE, null]), path + buildPath(matcherName))
}
bodyRepresentation[name] = invokeClosure(value, buildPath(matcherName))
} else {
bodyRepresentation[name] = value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class WildcardPactSpec extends Specification {
'$.body.articles[*].variants': [match: 'type'],
'$.body.articles[*].variants[*].*': [match: 'type'],
'$.body.articles[*].variants[*].*[*].bundles': [match: 'type'],
'$.body.articles[*].variants[*].*[*].bundles[*].*': [match: 'type'],
'$.body.articles[*].variants[*].*[*].bundles[*].*.description': [match: 'type'],
'$.body.articles[*].variants[*].*[*].bundles[*].*.referencedArticles': [match: 'type'],
'$.body.articles[*].variants[*].*[*].bundles[*].*.referencedArticles[*].bundleId': [match: 'type'],
Expand Down

0 comments on commit b449675

Please sign in to comment.