diff --git a/pom.xml b/pom.xml
index b3674f5eb..20142d250 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,7 +119,7 @@
2.2.0
2.1.0
2.2.2
- 1.5
+ 2.6.2
3.0
1.2.5
@@ -169,11 +169,23 @@
test
- xmlunit
- xmlunit
+ org.xmlunit
+ xmlunit-core
${xmlunit.version}
test
+
+ org.xmlunit
+ xmlunit-assertj
+ ${xmlunit.version}
+ test
+
+
+ org.assertj
+ assertj-core
+
+
+
org.assertj
assertj-core
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java
index 593db134a..ede7fb16a 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java
@@ -47,7 +47,6 @@
import org.springframework.xml.sax.SaxUtils;
import org.springframework.xml.transform.StringResult;
-import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Before;
import org.junit.Test;
import org.w3c.dom.Document;
@@ -56,7 +55,7 @@
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public abstract class AbstractWebServiceMessageTestCase {
@@ -78,7 +77,6 @@ public final void setUp() throws Exception {
transformer = transformerFactory.newTransformer();
webServiceMessage = createWebServiceMessage();
payload = new ClassPathResource("payload.xml", AbstractWebServiceMessageTestCase.class);
- XMLUnit.setIgnoreWhitespace(true);
}
@Test
@@ -92,7 +90,7 @@ public void testDomPayload() throws Exception {
Document resultDocument = documentBuilder.newDocument();
DOMResult domResult = new DOMResult(resultDocument);
transformer.transform(webServiceMessage.getPayloadSource(), domResult);
- assertXMLEqual(payloadDocument, resultDocument);
+ assertThat(resultDocument).and(payloadDocument).areSimilar();
validateMessage();
}
@@ -108,7 +106,7 @@ public void testEventReaderPayload() throws Exception {
Result staxResult = StaxUtils.createCustomStaxResult(eventWriter);
transformer.transform(webServiceMessage.getPayloadSource(), staxResult);
eventWriter.flush();
- assertXMLEqual(getExpectedString(), stringWriter.toString());
+ assertThat(stringWriter.toString()).and(getExpectedString()).areSimilar();
validateMessage();
}
@@ -120,7 +118,7 @@ public void testReaderPayload() throws Exception {
StringWriter resultWriter = new StringWriter();
StreamResult streamResult = new StreamResult(resultWriter);
transformer.transform(webServiceMessage.getPayloadSource(), streamResult);
- assertXMLEqual(getExpectedString(), resultWriter.toString());
+ assertThat(resultWriter.toString()).and(getExpectedString()).areSimilar();
}
@Test
@@ -129,7 +127,7 @@ public void testSaxPayload() throws Exception {
transformer.transform(saxSource, webServiceMessage.getPayloadResult());
StringResult stringResult = new StringResult();
transformer.transform(webServiceMessage.getPayloadSource(), stringResult);
- assertXMLEqual(getExpectedString(), stringResult.toString());
+ assertThat(stringResult.toString()).and(getExpectedString()).areSimilar();
validateMessage();
}
@@ -142,7 +140,7 @@ public void testStreamPayload() throws Exception {
transformer.transform(webServiceMessage.getPayloadSource(), streamResult);
ByteArrayOutputStream expectedStream = new ByteArrayOutputStream();
FileCopyUtils.copy(payload.getInputStream(), expectedStream);
- assertXMLEqual(expectedStream.toString("UTF-8"), resultStream.toString("UTF-8"));
+ assertThat(resultStream.toString("UTF-8")).and(expectedStream.toString("UTF-8")).areSimilar();
validateMessage();
}
@@ -158,7 +156,7 @@ public void testStreamReaderPayload() throws Exception {
Result staxResult = StaxUtils.createCustomStaxResult(streamWriter);
transformer.transform(webServiceMessage.getPayloadSource(), staxResult);
streamWriter.flush();
- assertXMLEqual(getExpectedString(), stringWriter.toString());
+ assertThat(stringWriter.toString()).and(getExpectedString()).areSimilar();
validateMessage();
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java
index 3296439e4..b91d4287d 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java
@@ -41,7 +41,7 @@
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import org.junit.AfterClass;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
@@ -118,7 +118,7 @@ public void sendSourceAndReceiveToResult() throws SAXException, IOException {
boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo",
new StringSource(messagePayload), result);
Assert.assertTrue("Invalid result", b);
- assertXMLEqual(messagePayload, result.toString());
+ assertThat(result.toString()).and(messagePayload).areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java
index 1a30aed40..de381c9cd 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java
@@ -43,7 +43,7 @@
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import org.junit.AfterClass;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
@@ -129,7 +129,7 @@ public void sendSourceAndReceiveToResult() throws SAXException, IOException {
boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo",
new StringSource(messagePayload), result);
Assert.assertTrue("Invalid result", b);
- assertXMLEqual(messagePayload, result.toString());
+ assertThat(result.toString()).and(messagePayload).areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java
index 046f72d7d..5ca6ca54b 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java
@@ -29,7 +29,7 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -79,7 +79,7 @@ public void domPox() throws Exception {
StringResult result = new StringResult();
template.sendSourceAndReceiveToResult(baseUrl + "/pox", new StringSource(content),
result);
- assertXMLEqual(content, result.toString());
+ assertThat(result.toString()).and(content).areSimilar();
try {
template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
new StringSource(content), new StringResult());
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java b/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java
index 5802ba8e0..6f65aa0de 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java
@@ -29,7 +29,7 @@
import org.junit.Test;
import org.w3c.dom.Document;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public class DomPoxMessageTest {
@@ -54,7 +54,7 @@ public void testGetPayload() throws Exception {
transformer.transform(source, message.getPayloadResult());
StringResult stringResult = new StringResult();
transformer.transform(message.getPayloadSource(), stringResult);
- assertXMLEqual(content, stringResult.toString());
+ assertThat(stringResult.toString()).and(content).areSimilar();
}
@Test
@@ -64,7 +64,7 @@ public void testGetPayloadResultTwice() throws Exception {
transformer.transform(new StringSource(content), message.getPayloadResult());
StringResult stringResult = new StringResult();
transformer.transform(message.getPayloadSource(), stringResult);
- assertXMLEqual(content, stringResult.toString());
+ assertThat(stringResult.toString()).and(content).areSimilar();
}
@Test
@@ -74,6 +74,6 @@ public void testWriteTo() throws Exception {
transformer.transform(source, message.getPayloadResult());
ByteArrayOutputStream os = new ByteArrayOutputStream();
message.writeTo(os);
- assertXMLEqual(content, os.toString("UTF-8"));
+ assertThat(os.toString("UTF-8")).and(content).areSimilar();
}
}
\ No newline at end of file
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java
index 928e47578..e126d10fc 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java
@@ -27,7 +27,7 @@
import org.junit.Before;
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -67,7 +67,7 @@ protected final void testSource(Source requestSource) throws Exception {
new DefaultMessageContext(new MockWebServiceMessage(requestSource), new MockWebServiceMessageFactory());
endpoint.invoke(context);
assertTrue("No response message created", context.hasResponse());
- assertXMLEqual(RESPONSE, ((MockWebServiceMessage) context.getResponse()).getPayloadAsString());
+ assertThat(((MockWebServiceMessage) context.getResponse()).getPayloadAsString()).and(RESPONSE).areSimilar();
}
protected abstract MessageEndpoint createNoResponseEndpoint();
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java
index 2c98bb085..386c21792 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java
@@ -26,7 +26,7 @@
import org.junit.Before;
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -63,7 +63,7 @@ protected final void testSource(Source requestSource) throws Exception {
assertNotNull("No response source returned", responseSource);
StringResult result = new StringResult();
transformer.transform(responseSource, result);
- assertXMLEqual(RESPONSE, result.toString());
+ assertThat(result.toString()).and(RESPONSE).areSimilar();
}
protected abstract PayloadEndpoint createNoResponseEndpoint() throws Exception;
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java
index 1649f6f21..3a7c6f62b 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java
@@ -27,7 +27,7 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.easymock.EasyMock.*;
import org.junit.Assert;
import static org.junit.Assert.fail;
@@ -73,7 +73,7 @@ public Object unmarshal(Source source) throws XmlMappingException {
try {
StringWriter writer = new StringWriter();
transformer.transform(source, new StreamResult(writer));
- assertXMLEqual("Invalid source", "", writer.toString());
+ assertThat(writer.toString()).and("").areSimilar();
return 42L;
}
catch (Exception e) {
@@ -112,7 +112,7 @@ protected Object invokeInternal(Object requestObject) throws Exception {
endpoint.invoke(context);
MockWebServiceMessage response = (MockWebServiceMessage) context.getResponse();
Assert.assertNotNull("Invalid result", response);
- assertXMLEqual("Invalid response", "", response.getPayloadAsString());
+ assertThat(response.getPayloadAsString()).and("").areSimilar();
verify(factoryMock);
}
@@ -125,7 +125,7 @@ public Object unmarshal(Source source) throws XmlMappingException {
try {
StringWriter writer = new StringWriter();
transformer.transform(source, new StreamResult(writer));
- assertXMLEqual("Invalid source", "", writer.toString());
+ assertThat(writer.toString()).and("").areSimilar();
return (long) 42;
}
catch (Exception e) {
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxStreamPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxStreamPayloadEndpointTest.java
index 45b9ce78f..f4c58ef5b 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxStreamPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxStreamPayloadEndpointTest.java
@@ -37,7 +37,7 @@
import org.apache.axiom.soap.SOAPFactory;
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.*;
/**
@@ -114,7 +114,7 @@ public void testSaajResponse() throws Exception {
assertTrue("context has not response", context.hasResponse());
StringResult stringResult = new StringResult();
transformer.transform(context.getResponse().getPayloadSource(), stringResult);
- assertXMLEqual(RESPONSE, stringResult.toString());
+ assertThat(stringResult.toString()).and(RESPONSE).areSimilar();
}
@Test
@@ -132,7 +132,7 @@ public void testAxiomResponse() throws Exception {
assertTrue("context has not response", context.hasResponse());
StringResult stringResult = new StringResult();
transformer.transform(context.getResponse().getPayloadSource(), stringResult);
- assertXMLEqual(RESPONSE, stringResult.toString());
+ assertThat(stringResult.toString()).and(RESPONSE).areSimilar();
}
@Test
@@ -167,7 +167,7 @@ public void testAxiomResponseNoPayloadCaching() throws Exception {
StringResult stringResult = new StringResult();
transformer.transform(context.getResponse().getPayloadSource(), stringResult);
- assertXMLEqual(RESPONSE, stringResult.toString());
+ assertThat(stringResult.toString()).and(RESPONSE).areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapterTest.java
index 0e138fa35..940c9dcba 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapterTest.java
@@ -34,7 +34,7 @@
import org.junit.Before;
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.easymock.EasyMock.*;
public class PayloadEndpointAdapterTest {
@@ -62,7 +62,7 @@ public void testInvoke() throws Exception {
public Source invoke(Source request) throws Exception {
StringWriter writer = new StringWriter();
transformer.transform(request, new StreamResult(writer));
- assertXMLEqual("Invalid request", "", writer.toString());
+ assertThat(writer.toString()).and("").areSimilar();
return new StreamSource(new StringReader(""));
}
};
@@ -71,7 +71,7 @@ public Source invoke(Source request) throws Exception {
adapter.invoke(messageContext, endpoint);
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
Assert.assertNotNull("No response created", response);
- assertXMLEqual("Invalid payload", "", response.getPayloadAsString());
+ assertThat(response.getPayloadAsString()).and("").areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java
index 4d7b0d03a..24ebeef31 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java
@@ -25,7 +25,7 @@
import org.junit.Before;
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -135,7 +135,7 @@ private void testHandleReturnValue(MessageContext messageContext) throws Excepti
Source responsePayload = messageContext.getResponse().getPayloadSource();
StringResult result = new StringResult();
transform(responsePayload, result);
- assertXMLEqual(XML, result.toString());
+ assertThat(result.toString()).and(XML).areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java
index 6baeaa758..d15bff37f 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java
@@ -40,7 +40,7 @@
import org.springframework.ws.soap.axiom.AxiomSoapMessageFactory;
import org.springframework.xml.transform.StringResult;
-import static org.custommonkey.xmlunit.XMLAssert.*;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -96,7 +96,7 @@ public void handleReturnValue() throws Exception {
processor.handleReturnValue(messageContext, supportedReturnType, element);
assertTrue("context has no response", messageContext.hasResponse());
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
- assertXMLEqual("Foo", response.getPayloadAsString());
+ assertThat(response.getPayloadAsString()).and("Foo").ignoreWhitespace().areSimilar();
}
@Test
@@ -108,7 +108,7 @@ public void handleReturnValueString() throws Exception {
processor.handleReturnValue(messageContext, stringReturnType, element);
assertTrue("context has no response", messageContext.hasResponse());
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
- assertXMLEqual("Foo", response.getPayloadAsString());
+ assertThat(response.getPayloadAsString()).and("Foo").ignoreWhitespace().areSimilar();
}
@Test
@@ -137,17 +137,15 @@ public void handleReturnValueAxiom() throws Exception {
StringResult payloadResult = new StringResult();
transformer.transform(response.getPayloadSource(), payloadResult);
- assertXMLEqual("Foo",
- payloadResult.toString());
+ assertThat(payloadResult.toString()).and("Foo").areSimilar();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
response.writeTo(bos);
String messageResult = bos.toString("UTF-8");
- assertXMLEqual("" +
+ assertThat(messageResult).and("" +
"Foo" +
- "", messageResult);
-
+ "").areSimilar();
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java
index dd3766a85..67eb18336 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java
@@ -50,7 +50,7 @@
import org.springframework.xml.sax.AbstractXmlReader;
import org.springframework.xml.transform.StringResult;
-import static org.custommonkey.xmlunit.XMLAssert.*;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -175,7 +175,7 @@ public void handleReturnValue() throws Exception {
processor.handleReturnValue(messageContext, rootElementReturnType, rootElement);
assertTrue("context has no response", messageContext.hasResponse());
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
- assertXMLEqual("Foo", response.getPayloadAsString());
+ assertThat(response.getPayloadAsString()).and("Foo").ignoreWhitespace().areSimilar();
}
@Test
@@ -203,17 +203,15 @@ public void handleReturnValueAxiom() throws Exception {
StringResult payloadResult = new StringResult();
transformer.transform(response.getPayloadSource(), payloadResult);
- assertXMLEqual("Foo",
- payloadResult.toString());
+ assertThat(payloadResult.toString()).and("Foo").areSimilar();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
response.writeTo(bos);
String messageResult = bos.toString("UTF-8");
- assertXMLEqual("" +
+ assertThat(messageResult).and("" +
"Foo" +
- "", messageResult);
-
+ "").ignoreWhitespace().areSimilar();
}
@Test
@@ -233,10 +231,9 @@ public void handleReturnValueAxiomNoPayloadCaching() throws Exception {
response.writeTo(bos);
String messageResult = bos.toString("UTF-8");
- assertXMLEqual("" +
+ assertThat(messageResult).and("" +
"Foo" +
- "", messageResult);
-
+ "").areSimilar();
}
@ResponsePayload
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java
index d88cc9d7a..413d6cc3d 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java
@@ -22,8 +22,7 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXSource;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
-import org.custommonkey.xmlunit.XMLUnit;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -62,7 +61,6 @@ public void setUp() throws Exception {
input = new ClassPathResource("transformInput.xml", getClass());
output = new ClassPathResource("transformOutput.xml", getClass());
xslt = new ClassPathResource("transformation.xslt", getClass());
- XMLUnit.setIgnoreWhitespace(true);
}
@Test
@@ -76,7 +74,7 @@ public void testHandleRequest() throws Exception {
Assert.assertTrue("Invalid interceptor result", result);
StringResult expected = new StringResult();
transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
- assertXMLEqual(expected.toString(), request.getPayloadAsString());
+ assertThat(request.getPayloadAsString()).and(expected.toString()).ignoreWhitespace().areSimilar();
}
@Test
@@ -90,7 +88,7 @@ public void testHandleRequestNoXslt() throws Exception {
Assert.assertTrue("Invalid interceptor result", result);
StringResult expected = new StringResult();
transformer.transform(new SAXSource(SaxUtils.createInputSource(input)), expected);
- assertXMLEqual(expected.toString(), request.getPayloadAsString());
+ assertThat(request.getPayloadAsString()).and(expected.toString()).areSimilar();
}
@Test
@@ -106,7 +104,7 @@ public void testHandleResponse() throws Exception {
Assert.assertTrue("Invalid interceptor result", result);
StringResult expected = new StringResult();
transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
- assertXMLEqual(expected.toString(), response.getPayloadAsString());
+ assertThat(response.getPayloadAsString()).and(expected.toString()).ignoreWhitespace().areSimilar();
}
@Test
@@ -122,7 +120,7 @@ public void testHandleResponseNoXslt() throws Exception {
Assert.assertTrue("Invalid interceptor result", result);
StringResult expected = new StringResult();
transformer.transform(new SAXSource(SaxUtils.createInputSource(input)), expected);
- assertXMLEqual(expected.toString(), response.getPayloadAsString());
+ assertThat(response.getPayloadAsString()).and(expected.toString()).areSimilar();
}
@Test
@@ -140,8 +138,7 @@ public void testSaaj() throws Exception {
transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
StringResult result = new StringResult();
transformer.transform(message.getPayloadSource(), result);
- assertXMLEqual(expected.toString(), result.toString());
-
+ assertThat(result.toString()).and(expected.toString()).ignoreWhitespace().areSimilar();
}
@Test
@@ -158,8 +155,7 @@ public void testPox() throws Exception {
transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
StringResult result = new StringResult();
transformer.transform(message.getPayloadSource(), result);
- assertXMLEqual(expected.toString(), result.toString());
-
+ assertThat(result.toString()).and(expected.toString()).ignoreWhitespace().areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapBodyTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapBodyTestCase.java
index aee0c4bf4..be50301a3 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapBodyTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapBodyTestCase.java
@@ -27,7 +27,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.*;
public abstract class AbstractSoapBodyTestCase extends AbstractSoapElementTestCase {
@@ -77,7 +77,7 @@ public void testAddFaultWithExistingPayload() throws Exception {
protected void assertPayloadEqual(String expectedPayload) throws Exception {
StringResult result = new StringResult();
transformer.transform(soapBody.getPayloadSource(), result);
- assertXMLEqual("Invalid payload contents", expectedPayload, result.toString());
+ assertThat(result.toString()).and(expectedPayload).areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java
index 3af56a143..0d2546881 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java
@@ -24,7 +24,7 @@
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.*;
public abstract class AbstractSoapHeaderTestCase extends AbstractSoapElementTestCase {
@@ -82,9 +82,7 @@ public void testExamineAllHeaderElement() throws Exception {
assertEquals("Invalid qName for element", qName, headerElement.getName());
StringResult result = new StringResult();
transformer.transform(headerElement.getSource(), result);
- assertXMLEqual("Invalid contents of header element",
- "",
- result.toString());
+ assertThat(result.toString()).and("").areSimilar();
assertFalse("header element iterator has too many elements", iterator.hasNext());
}
@@ -137,8 +135,6 @@ public void testGetResult() throws Exception {
protected void assertHeaderElementEqual(SoapHeaderElement headerElement, String expected) throws Exception {
StringResult result = new StringResult();
transformer.transform(headerElement.getSource(), result);
- assertXMLEqual("Invalid contents of header element", expected, result.toString());
+ assertThat(result.toString()).and(expected).areSimilar();
}
-
-
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java
index f317a0ea7..5c4dc7612 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java
@@ -39,7 +39,7 @@
import org.springframework.xml.validation.XmlValidator;
import org.springframework.xml.validation.XmlValidatorFactory;
-import static org.custommonkey.xmlunit.XMLAssert.*;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -123,7 +123,7 @@ public void writeTo(XMLStreamWriter streamWriter) throws XMLStreamException {
transformer.transform(streamingMessage.getPayloadSource(), result);
String expected = "Foo";
- assertXMLEqual(expected, result.toString());
+ assertThat(result.toString()).and(expected).areSimilar();
soapMessage.writeTo(new ByteArrayOutputStream());
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java
index 6993b2bf2..a7dbd821f 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java
@@ -23,13 +23,12 @@
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPException;
-import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Before;
import org.w3c.dom.Document;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
-import static org.custommonkey.xmlunit.XMLUnit.compareXML;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.*;
public abstract class AbstractWsAddressingTestCase {
@@ -39,10 +38,8 @@ public abstract class AbstractWsAddressingTestCase {
@Before
public void createMessageFactory() throws Exception {
messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
- XMLUnit.setIgnoreWhitespace(true);
}
-
protected SaajSoapMessage loadSaajMessage(String fileName) throws SOAPException, IOException {
MimeHeaders mimeHeaders = new MimeHeaders();
mimeHeaders.addHeader("Content-Type", " application/soap+xml");
@@ -56,15 +53,9 @@ protected SaajSoapMessage loadSaajMessage(String fileName) throws SOAPException,
}
}
- protected void assertXMLEqual(String message, SaajSoapMessage expected, SaajSoapMessage result) {
- Document expectedDocument = expected.getSaajMessage().getSOAPPart();
- Document resultDocument = result.getSaajMessage().getSOAPPart();
- org.custommonkey.xmlunit.XMLAssert.assertXMLEqual(message, expectedDocument, resultDocument);
- }
-
- protected void assertXMLSimilar(String message, SaajSoapMessage expected, SaajSoapMessage result) {
+ protected void assertXMLSimilar(SaajSoapMessage expected, SaajSoapMessage result) {
Document expectedDocument = expected.getSaajMessage().getSOAPPart();
Document resultDocument = result.getSaajMessage().getSOAPPart();
- org.custommonkey.xmlunit.XMLAssert.assertXMLEqual(compareXML(expectedDocument, resultDocument), false);
+ assertThat(resultDocument).and(expectedDocument).ignoreWhitespace().areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/AbstractActionCallbackTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/AbstractActionCallbackTestCase.java
index 94d4e081c..832ccc3aa 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/AbstractActionCallbackTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/AbstractActionCallbackTestCase.java
@@ -78,7 +78,7 @@ public void testValid() throws Exception {
callback.doWithMessage(message);
SaajSoapMessage expected = loadSaajMessage(getTestPath() + "/valid.xml");
- assertXMLSimilar("Invalid message", expected, message);
+ assertXMLSimilar(expected, message);
verify(strategyMock, connectionMock);
}
@@ -100,7 +100,7 @@ public void testDefaults() throws Exception {
callback.doWithMessage(message);
SaajSoapMessage expected = loadSaajMessage(getTestPath() + "/valid.xml");
- assertXMLSimilar("Invalid message", expected, message);
+ assertXMLSimilar(expected, message);
verify(strategyMock, connectionMock);
}
@@ -108,7 +108,7 @@ private SaajSoapMessage createDeleteMessage() throws SOAPException {
SOAPMessage saajMessage = messageFactory.createMessage();
SOAPBody saajBody = saajMessage.getSOAPBody();
SOAPBodyElement delete = saajBody.addBodyElement(new QName("http://example.com/fabrikam", "Delete"));
- SOAPElement maxCount = delete.addChildElement(new QName("maxCount"));
+ SOAPElement maxCount = delete.addChildElement("maxCount");
maxCount.setTextContent("42");
return new SaajSoapMessage(saajMessage);
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AbstractAddressingInterceptorTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AbstractAddressingInterceptorTestCase.java
index a1a169fd1..aa274e045 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AbstractAddressingInterceptorTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AbstractAddressingInterceptorTestCase.java
@@ -96,8 +96,7 @@ public void testNoMessageId() throws Exception {
assertFalse("Request with no MessageID handled", result);
assertTrue("Message Context has no response", context.hasResponse());
SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-no-message-id.xml");
- assertXMLEqual("Invalid response for message with no MessageID", expectedResponse,
- (SaajSoapMessage) context.getResponse());
+ assertXMLSimilar(expectedResponse, (SaajSoapMessage) context.getResponse());
verify(strategyMock);
}
@@ -115,8 +114,7 @@ public void testNoReplyTo() throws Exception {
assertTrue("Request with no ReplyTo not handled", result);
assertTrue("Message Context has no response", context.hasResponse());
SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-anonymous.xml");
- assertXMLEqual("Invalid response for message with invalid MAP", expectedResponse,
- (SaajSoapMessage) context.getResponse());
+ assertXMLSimilar(expectedResponse, (SaajSoapMessage) context.getResponse());
verify(strategyMock);
}
@@ -133,8 +131,7 @@ public void testAnonymousReplyTo() throws Exception {
boolean result = interceptor.handleResponse(context, null);
assertTrue("Request with anonymous ReplyTo not handled", result);
SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-anonymous.xml");
- assertXMLEqual("Invalid response for message with invalid MAP", expectedResponse,
- (SaajSoapMessage) context.getResponse());
+ assertXMLSimilar(expectedResponse, (SaajSoapMessage) context.getResponse());
verify(strategyMock);
}
@@ -162,8 +159,7 @@ public void testFaultTo() throws Exception {
boolean result = interceptor.handleFault(context, null);
assertTrue("Request with anonymous FaultTo not handled", result);
SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-fault-to.xml");
- assertXMLEqual("Invalid response for message with invalid MAP", expectedResponse,
- (SaajSoapMessage) context.getResponse());
+ assertXMLSimilar(expectedResponse, (SaajSoapMessage) context.getResponse());
verify(strategyMock);
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java
index e59d0f98c..00859db89 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java
@@ -28,6 +28,7 @@
import static org.easymock.EasyMock.*;
import static org.junit.Assert.assertTrue;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public class AddressingInterceptor10Test extends AbstractAddressingInterceptorTestCase {
@@ -51,9 +52,7 @@ public void testNoTo() throws Exception {
assertTrue("Request with no To not handled", result);
assertTrue("Message Context has no response", context.hasResponse());
SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-anonymous.xml");
- assertXMLEqual("Invalid response for message with invalid MAP", expectedResponse,
- (SaajSoapMessage) context.getResponse());
+ assertThat(context.getResponse()).and(expectedResponse).areSimilar();
verify(strategyMock);
}
-
}
\ No newline at end of file
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java
index 13ab060b0..dfcbd8676 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java
@@ -16,7 +16,6 @@
package org.springframework.ws.soap.addressing.server;
-import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.StaticApplicationContext;
@@ -56,7 +55,6 @@ public class AnnotationActionMethodEndpointMappingTest {
@Before
public void setUp() throws Exception {
messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
- XMLUnit.setIgnoreWhitespace(true);
applicationContext = new StaticApplicationContext();
applicationContext.registerSingleton("mapping", AnnotationActionEndpointMapping.class);
applicationContext.registerSingleton("interceptor", MyInterceptor.class);
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11MessageFactoryTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11MessageFactoryTest.java
index 457c5d8e8..e6a069fc0 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11MessageFactoryTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11MessageFactoryTest.java
@@ -30,13 +30,13 @@
import org.springframework.ws.transport.TransportInputStream;
import org.springframework.xml.transform.StringResult;
-import org.custommonkey.xmlunit.XMLAssert;
-import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
+
public class AxiomSoap11MessageFactoryTest extends AbstractSoap11MessageFactoryTestCase {
private Transformer transformer;
@@ -130,7 +130,6 @@ public void testSWS502() throws Exception {
StringResult result = new StringResult();
transformer.transform(message.getPayloadSource(), result);
- XMLUnit.setIgnoreWhitespace(true);
String expectedPayload =
"" +
"" +
@@ -138,8 +137,6 @@ public void testSWS502() throws Exception {
"true" + "0" +
"ok]]]]>>" +
"]]>" + "";
- XMLAssert.assertXMLEqual(expectedPayload, result.toString());
-
+ assertThat(result.toString()).and(expectedPayload).areSimilar();
}
-
}
\ No newline at end of file
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/NonCachingPayloadTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/NonCachingPayloadTest.java
index fa096d3fa..995639495 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/NonCachingPayloadTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/NonCachingPayloadTest.java
@@ -27,7 +27,7 @@
import org.junit.Before;
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
@SuppressWarnings("Since15")
public class NonCachingPayloadTest {
@@ -63,7 +63,7 @@ public void testDelegatingStreamWriter() throws Exception {
String expected = "" +
"" + "text" + ""
;
- assertXMLEqual(expected, writer.toString());
+ assertThat(writer.toString()).and(expected).areSimilar();
}
@Test
@@ -85,7 +85,7 @@ public void testDelegatingStreamWriterWriteEndDocument() throws Exception {
String expected = "" +
"" + "text" + ""
;
- assertXMLEqual(expected, writer.toString());
+ assertThat(writer.toString()).and(expected).areSimilar();
}
@Test
@@ -105,6 +105,6 @@ public void testDelegatingStreamWriterWriteEmptyElement() throws Exception {
String expected = "" +
"" + "" + "";
- assertXMLEqual(expected, writer.toString());
+ assertThat(writer.toString()).and(expected).areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/support/AxiomUtilsTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/support/AxiomUtilsTest.java
index 52f5c1a21..280f9ca02 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/support/AxiomUtilsTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/support/AxiomUtilsTest.java
@@ -35,13 +35,12 @@
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPMessage;
import org.apache.axiom.soap.SOAPModelBuilder;
-import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.w3c.dom.Document;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public class AxiomUtilsTest {
@@ -52,7 +51,6 @@ public void setUp() throws Exception {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace namespace = factory.createOMNamespace("http://www.springframework.org", "prefix");
element = factory.createOMElement("element", namespace);
- XMLUnit.setIgnoreWhitespace(true);
}
@Test
@@ -117,7 +115,7 @@ public void testToDocument() throws Exception {
Document result = AxiomUtils.toDocument(soapMessage.getSOAPEnvelope());
- assertXMLEqual("Invalid document generated from SOAPEnvelope", expected, result);
+ assertThat(result).and(expected).areSimilar();
}
@Test
@@ -137,6 +135,6 @@ public void testToEnvelope() throws Exception {
envelope.serialize(writer);
String result = writer.toString();
- assertXMLEqual("Invalid SOAPEnvelope generated from document", expected, result);
+ assertThat(result).and(expected).areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageTest.java
index 50a24effd..8bcc3ffe7 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageTest.java
@@ -32,7 +32,7 @@
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
-import static org.custommonkey.xmlunit.XMLAssert.*;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -64,7 +64,7 @@ public void testGetPayloadSource() throws Exception {
Source source = soapMessage.getPayloadSource();
StringResult result = new StringResult();
transformer.transform(source, result);
- assertXMLEqual("Invalid source", "", result.toString());
+ assertThat(result.toString()).and("").areSimilar();
}
@Test
@@ -75,7 +75,7 @@ public void testGetPayloadSourceText() throws Exception {
Source source = soapMessage.getPayloadSource();
StringResult result = new StringResult();
transformer.transform(source, result);
- assertXMLEqual("Invalid source", "", result.toString());
+ assertThat(result.toString()).and("").areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap12MessageTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap12MessageTest.java
index 109c55832..5faca0bb7 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap12MessageTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap12MessageTest.java
@@ -27,7 +27,7 @@
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -58,7 +58,7 @@ public void testGetPayloadSource() throws Exception {
Source source = soapMessage.getPayloadSource();
StringResult result = new StringResult();
transformer.transform(source, result);
- assertXMLEqual("Invalid source", "", result.toString());
+ assertThat(result.toString()).and("").areSimilar();
}
public void testGetPayloadSourceText() throws Exception {
@@ -67,7 +67,7 @@ public void testGetPayloadSourceText() throws Exception {
Source source = soapMessage.getPayloadSource();
StringResult result = new StringResult();
transformer.transform(source, result);
- assertXMLEqual("Invalid source", "", result.toString());
+ assertThat(result.toString()).and("").areSimilar();
}
public void testGetPayloadResult() throws Exception {
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajUtilsTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajUtilsTest.java
index 998bd13b9..edc9d41b3 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajUtilsTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajUtilsTest.java
@@ -36,7 +36,7 @@
import org.junit.Test;
import org.w3c.dom.Document;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public class SaajUtilsTest {
@@ -125,7 +125,7 @@ public void testLoadMessage() throws Exception {
Document document = builder.parse(getClass().getResourceAsStream("soapMessage.xml"));
SOAPMessage soapMessage =
SaajUtils.loadMessage(new ClassPathResource("soapMessage.xml", getClass()), messageFactory);
- assertXMLEqual(soapMessage.getSOAPPart(), document);
+ assertThat(document).and(soapMessage.getSOAPPart()).areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajXmlReaderTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajXmlReaderTest.java
index 63991ffd2..7eeb5b028 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajXmlReaderTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/support/SaajXmlReaderTest.java
@@ -31,7 +31,7 @@
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public class SaajXmlReaderTest {
@@ -59,7 +59,7 @@ public void testNamespacesPrefixes() throws Exception {
transformer.transform(source, result);
DOMResult expected = new DOMResult();
transformer.transform(new DOMSource(message.getSOAPPart().getEnvelope()), expected);
- assertXMLEqual((Document) expected.getNode(), (Document) result.getNode());
+ assertThat(result.getNode()).and(expected.getNode()).areSimilar();
}
@Test
@@ -71,6 +71,6 @@ public void testNamespacesNoPrefixes() throws Exception {
transformer.transform(source, result);
DOMResult expected = new DOMResult();
transformer.transform(new DOMSource(message.getSOAPPart().getEnvelope()), expected);
- assertXMLEqual((Document) expected.getNode(), (Document) result.getNode());
+ assertThat(result.getNode()).and(expected.getNode()).areSimilar();
}
}
\ No newline at end of file
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java
index 1254a260c..0186c39e5 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java
@@ -54,7 +54,7 @@
import org.springframework.xml.validation.ValidationErrorHandler;
import org.springframework.xml.xsd.SimpleXsdSchema;
-import static org.custommonkey.xmlunit.XMLAssert.*;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public class PayloadValidatingInterceptorTest {
@@ -302,14 +302,12 @@ public void testCreateRequestValidationFaultAxiom() throws Exception {
interceptor.handleRequestValidationErrors(messageContext, exceptions);
ByteArrayOutputStream os = new ByteArrayOutputStream();
messageContext.getResponse().writeTo(os);
- assertXMLEqual(
- "" + "" + "" +
+ assertThat(os.toString()).and("" + "" + "" +
"" + "soapenv:Client" +
"Validation error" + "" +
"Message 1" +
"Message 2" +
- "" + "" + "" + "", os.toString());
-
+ "" + "" + "" + "").areSimilar();
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java
index f60c321c8..5566754fc 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java
@@ -29,7 +29,7 @@
import org.junit.Test;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.xmlunit.assertj.XmlAssert.assertThat;
import static org.junit.Assert.*;
public abstract class AbstractSoap11BodyTestCase extends AbstractSoapBodyTestCase {
@@ -48,8 +48,7 @@ public void testGetName() throws Exception {
public void testGetSource() throws Exception {
StringResult result = new StringResult();
transformer.transform(soapBody.getSource(), result);
- assertXMLEqual("Invalid contents of body", "",
- result.toString());
+ assertThat(result.toString()).and("