Remove Json matching
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user