Should not fail when matchers don't have dots

fixes gh-894
This commit is contained in:
Marcin Grzejszczak
2019-10-31 14:58:40 +01:00
parent 3f834e6062
commit cf37bc666a
2 changed files with 33 additions and 3 deletions

View File

@@ -2669,6 +2669,32 @@ class WireMockGroovyDslSpec extends Specification implements WireMockStubVerifie
}
@Issue("#894")
def "should not fail when matchers don't have dots"() {
given:
Contract contractDsl = Contract.make {
request {
method 'POST'
url "/example"
body([ "123", "234"])
bodyMatchers {
jsonPath('$[*]', byRegex(nonEmpty()))
}
}
response {
status 201
}
}
when:
String wireMockStub = new WireMockStubStrategy("Test",
new ContractMetadata(null, false, 0, null, contractDsl), contractDsl)
.toWireMockClientStub()
then:
stubMappingIsValidWireMockStub(wireMockStub)
}
WireMockConfiguration config() {
return new WireMockConfiguration().extensions(responseTemplateTransformer())
}