Polishing

This commit is contained in:
Juergen Hoeller
2015-09-08 18:11:30 +02:00
parent 5c22002d21
commit 52fdfd59ab
11 changed files with 44 additions and 43 deletions

View File

@@ -16,13 +16,9 @@
package org.springframework.test.util;
import static org.hamcrest.MatcherAssert.*;
import static org.springframework.test.util.AssertionErrors.*;
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -42,6 +38,9 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.SimpleNamespaceContext;
import static org.hamcrest.MatcherAssert.*;
import static org.springframework.test.util.AssertionErrors.*;
/**
* A helper class for applying assertions via XPath expressions.
*
@@ -113,7 +112,7 @@ public class XpathExpectationsHelper {
factory.setNamespaceAware(this.hasNamespaces);
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
InputSource inputSource = new InputSource(new ByteArrayInputStream(xml));
if(StringUtils.hasText(encoding)) {
if (StringUtils.hasText(encoding)) {
inputSource.setEncoding(encoding);
}
return documentBuilder.parse(inputSource);