Merge pull request #85 from dstepanov/removeJsonMatching

Remove extra Json matching
This commit is contained in:
Marcin Grzejszczak
2015-06-15 18:31:48 +02:00
2 changed files with 0 additions and 56 deletions

View File

@@ -125,26 +125,6 @@ class Request extends Common {
return new MatchingStrategy(value, MatchingStrategy.Type.EQUAL_TO_JSON)
}
MatchingStrategy equalToJson(Object value, JSONCompareMode jsonCompareMode) {
return new MatchingStrategy(value, MatchingStrategy.Type.EQUAL_TO_JSON)
}
MatchingStrategy equalToJsonStrictly(Object value) {
return new MatchingStrategy(value, MatchingStrategy.Type.EQUAL_TO_JSON, JSONCompareMode.STRICT)
}
MatchingStrategy equalToJsonLeniently(Object value) {
return new MatchingStrategy(value, MatchingStrategy.Type.EQUAL_TO_JSON, JSONCompareMode.LENIENT)
}
MatchingStrategy equalToJsonNonExtensibly(Object value) {
return new MatchingStrategy(value, MatchingStrategy.Type.EQUAL_TO_JSON, JSONCompareMode.NON_EXTENSIBLE)
}
MatchingStrategy equalToJsonWithStrictOrder(Object value) {
return new MatchingStrategy(value, MatchingStrategy.Type.EQUAL_TO_JSON, JSONCompareMode.STRICT_ORDER)
}
}
@CompileStatic

View File

@@ -400,42 +400,6 @@ class WiremockGroovyDslSpec extends WiremockSpec {
stubMappingIsValidWiremockStub(json)
}
def 'should use equalToJson compare mode'() {
given:
GroovyDsl groovyDsl = GroovyDsl.make {
request {
method 'GET'
url "/users"
body equalToJsonWithStrictOrder('''{"name":"Jan"}''')
}
response {
status 200
}
}
when:
String json = toWiremockClientJsonStub(groovyDsl)
then:
parseJson(json) == parseJson('''
{
"request": {
"method": "GET",
"url": "/users",
"bodyPatterns": [
{
"equalToJson":"{\\"name\\":\\"Jan\\"}",
"jsonCompareMode":"STRICT_ORDER"
}
]
},
"response": {
"status": 200
}
}
''')
and:
stubMappingIsValidWiremockStub(json)
}
def 'should use equalToJson'() {
given:
GroovyDsl groovyDsl = GroovyDsl.make {