Default handler for XmlSlurper (#879)

* Default handler for XmlSlurper
This commit is contained in:
konstantinshevchuk
2019-02-13 13:02:05 +01:00
committed by Olga Maciaszek-Sharma
parent d27020bfdf
commit 59954d1da0
3 changed files with 31 additions and 7 deletions

View File

@@ -3,9 +3,11 @@ package org.springframework.cloud.contract.verifier.util
import org.springframework.cloud.contract.spec.internal.DslProperty
import org.springframework.cloud.contract.verifier.util.ContentUtils
import spock.lang.Specification
import org.xml.sax.helpers.DefaultHandler
/**
* @author Marcin Grzejszczak
* @author Konstantin Shevchuk
*/
class ContentUtilsSpec extends Specification {
@@ -22,4 +24,11 @@ class ContentUtilsSpec extends Specification {
expect:
"test" == ContentUtils.GET_TEST_SIDE(dslProperty)
}
def "should return XmlSlurper with default error handler"() {
given:
XmlSlurper xmlSlurper = ContentUtils.getXmlSlurperWithDefaultErrorHandler()
expect:
xmlSlurper.getErrorHandler() instanceof DefaultHandler
}
}