import groovy.json.JsonSlurper def response = messageExchange.response.responseContent log.info "response : "+ response def slurper = new JsonSlurper() def json = slurper.parseText response log.info "json : "+ json log.info "json size : "+json.size() assert json.SecId.size() == 6 log.info "The first json : "+json[0] log.info "The first SecId : "+json[0].SecId assert json[0].SecId =="0P0000187J"
JsonSlurper (groovy 2.4.3 API) : http://docs.groovy-lang.org/latest/html/gapi/groovy/json/JsonSlurper.html
时间: 2024-11-07 01:38:58