Skip to content

Commit 6224ddd

Browse files
committed
Polishing (including removal of javadoc imports that show as package cycles in IntelliJ)
(cherry picked from commit 2a52dec)
1 parent 25c7e36 commit 6224ddd

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

spring-test-mvc/src/main/java/org/springframework/test/util/XmlExpectationsHelper.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,11 +16,8 @@
1616

1717
package org.springframework.test.util;
1818

19-
import static org.springframework.test.util.MatcherAssertionErrors.assertThat;
20-
2119
import java.io.StringReader;
2220
import java.util.Map;
23-
2421
import javax.xml.parsers.DocumentBuilder;
2522
import javax.xml.parsers.DocumentBuilderFactory;
2623
import javax.xml.transform.Source;
@@ -29,11 +26,12 @@
2926
import org.custommonkey.xmlunit.Diff;
3027
import org.custommonkey.xmlunit.XMLUnit;
3128
import org.hamcrest.Matcher;
32-
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
3329
import org.w3c.dom.Document;
3430
import org.w3c.dom.Node;
3531
import org.xml.sax.InputSource;
3632

33+
import static org.springframework.test.util.MatcherAssertionErrors.*;
34+
3735
/**
3836
* A helper class for assertions on XML content.
3937
*
@@ -42,7 +40,6 @@
4240
*/
4341
public class XmlExpectationsHelper {
4442

45-
4643
/**
4744
* Parse the content as {@link Node} and apply a {@link Matcher}.
4845
*/
@@ -56,8 +53,7 @@ private Document parseXmlString(String xml) throws Exception {
5653
factory.setNamespaceAware(true);
5754
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
5855
InputSource inputSource = new InputSource(new StringReader(xml));
59-
Document document = documentBuilder.parse(inputSource);
60-
return document;
56+
return documentBuilder.parse(inputSource);
6157
}
6258

6359
/**
@@ -73,18 +69,14 @@ public void assertSource(String content, Matcher<? super Source> matcher) throws
7369
* Parse the expected and actual content strings as XML and assert that the
7470
* two are "similar" -- i.e. they contain the same elements and attributes
7571
* regardless of order.
76-
*
7772
* <p>Use of this method assumes the
7873
* <a href="http://xmlunit.sourceforge.net/">XMLUnit<a/> library is available.
79-
*
8074
* @param expected the expected XML content
8175
* @param actual the actual XML content
82-
*
83-
* @see MockMvcResultMatchers#xpath(String, Object...)
84-
* @see MockMvcResultMatchers#xpath(String, Map, Object...)
76+
* @see org.springframework.test.web.servlet.result.MockMvcResultMatchers#xpath(String, Object...)
77+
* @see org.springframework.test.web.servlet.result.MockMvcResultMatchers#xpath(String, Map, Object...)
8578
*/
8679
public void assertXmlEqual(String expected, String actual) throws Exception {
87-
8880
XMLUnit.setIgnoreWhitespace(true);
8981
XMLUnit.setIgnoreComments(true);
9082
XMLUnit.setIgnoreAttributeOrder(true);

0 commit comments

Comments
 (0)