Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ protected Diff createDiff(Source payload) {
Document actualDocument = createDocumentFromSource(payload);
return DiffBuilder.compare(expectedDocument) //
.withTest(actualDocument) //
.ignoreWhitespace() //
.checkForSimilar() //
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ public void match() {
verify(message);
}

@Test
public void matchIgnoringWhitespace() {

String xml = "<response><success>true</success></response>";
String xmlWithAdditionalWhitespace = "<response> <success>true</success> </response>";
WebServiceMessage message = createMock(WebServiceMessage.class);
expect(message.getPayloadSource()).andReturn(new StringSource(xml)).times(2);
replay(message);

PayloadDiffMatcher matcher = new PayloadDiffMatcher(new StringSource(xmlWithAdditionalWhitespace));
matcher.match(message);

verify(message);
}


@Test
public void nonMatch() {

Expand Down