Merge branch '2.2.x'
This commit is contained in:
@@ -123,7 +123,7 @@ class WireMockResponseStubStrategy extends BaseWireMockStubStrategy {
|
||||
}
|
||||
|
||||
Closure parsingClosureForContentType() {
|
||||
return contractMetadata.getDefinedOutputTestContentType().contains("/stream") ? Closure.IDENTITY : MapConverter.JSON_PARSING_CLOSURE;
|
||||
return contractMetadata.getDefinedOutputStubContentType().contains("/stream") ? Closure.IDENTITY : MapConverter.JSON_PARSING_CLOSURE;
|
||||
}
|
||||
|
||||
private void appendResponseDelayTime(ResponseDefinitionBuilder builder) {
|
||||
|
||||
@@ -45,7 +45,12 @@ class WireMockResponseStubStrategySpec extends Specification {
|
||||
when:
|
||||
SingleContractMetadata metadata = Stub()
|
||||
metadata.evaluatedOutputStubContentType >> ContentType.JSON
|
||||
def subject = new WireMockResponseStubStrategy(contract, metadata)
|
||||
def subject = new WireMockResponseStubStrategy(contract, metadata) {
|
||||
@Override
|
||||
protected Closure parsingClosureForContentType() {
|
||||
return MapConverter.JSON_PARSING_CLOSURE
|
||||
}
|
||||
}
|
||||
def content = subject.buildClientResponseContent()
|
||||
then:
|
||||
'{"value":1.5}' == content.body
|
||||
@@ -73,7 +78,12 @@ class WireMockResponseStubStrategySpec extends Specification {
|
||||
when:
|
||||
SingleContractMetadata metadata = Stub()
|
||||
metadata.evaluatedOutputStubContentType >> ContentType.JSON
|
||||
def subject = new WireMockResponseStubStrategy(contract, metadata)
|
||||
def subject = new WireMockResponseStubStrategy(contract, metadata) {
|
||||
@Override
|
||||
protected Closure parsingClosureForContentType() {
|
||||
return MapConverter.JSON_PARSING_CLOSURE
|
||||
}
|
||||
}
|
||||
def content = subject.buildClientResponseContent()
|
||||
then:
|
||||
Map body = new JsonSlurper().parseText(content.body) as Map
|
||||
|
||||
Reference in New Issue
Block a user