Let mock server write response in UTF-8
This commit is contained in:
parent
dbfb3727af
commit
57a6e06ac0
3 changed files with 45 additions and 6 deletions
|
@ -13,7 +13,7 @@ import org.apache.http.util.EntityUtils
|
|||
class Util {
|
||||
static GPathResult extractXmlResponse(CloseableHttpResponse response) {
|
||||
HttpEntity entity = response.entity
|
||||
GPathResult xml = new XmlSlurper().parseText(EntityUtils.toString(entity))
|
||||
GPathResult xml = new XmlSlurper().parseText(EntityUtils.toString(entity, 'UTF-8'))
|
||||
EntityUtils.consumeQuietly(entity)
|
||||
return xml
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class Util {
|
|||
|
||||
static Object extractJsonResponse(CloseableHttpResponse response) {
|
||||
HttpEntity entity = response.entity
|
||||
Object json = new JsonSlurper().parseText(EntityUtils.toString(entity))
|
||||
Object json = new JsonSlurper().parseText(EntityUtils.toString(entity, 'UTF-8'))
|
||||
EntityUtils.consumeQuietly(entity)
|
||||
return json
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue