Skip to content

Commit 5d8312b

Browse files
committed
minor test refactoring
1 parent ae4e96a commit 5d8312b

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/test/java/com/fasterxml/jackson/dataformat/xml/failing/TestUnwrappedDeserIssue86.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ public boolean equals(final Object other) {
4848
/* Test methods
4949
/***********************************************************************
5050
*/
51-
51+
5252
public void testDeserializeUnwrappedListWhenLocalNameForRootElementAndXmlPropertyMatch() throws Exception
5353
{
54-
final String source =
55-
"<test id=\"0\">" +
56-
"<test id=\"0.1\">" +
57-
"<test id=\"0.1.1\"/>" +
58-
"</test>" +
59-
"<test id=\"0.2\"/>" +
60-
"<test id=\"0.3\">" +
61-
"<test id=\"0.3.1\"/>" +
62-
"</test>" +
54+
final String sourceIndented =
55+
"<test id=\"0\">\n" +
56+
"<test id=\"0.1\">\n" +
57+
"<test id=\"0.1.1\"/>\n" +
58+
"</test>\n" +
59+
"<test id=\"0.2\"/>\n" +
60+
"<test id=\"0.3\">\n" +
61+
"<test id=\"0.3.1\"/>\n" +
62+
"</test>\n" +
6363
"</test>";
64-
64+
final String sourceCompact = sourceIndented.replaceAll("\n", "");
6565
final Issue86 before = new Issue86("0",
6666
Arrays.asList(new Issue86("0.1",
6767
Arrays.asList(new Issue86("0.1.1", null))),
@@ -74,11 +74,9 @@ public void testDeserializeUnwrappedListWhenLocalNameForRootElementAndXmlPropert
7474
mapper.setSerializationInclusion(Include.NON_NULL);
7575

7676
final String xml = mapper.writeValueAsString(before);
77-
assertEquals(source, xml);
77+
assertEquals(sourceCompact, xml);
7878

79-
final Issue86 after = mapper.readValue(xml, Issue86.class);
79+
final Issue86 after = mapper.readValue(sourceIndented, Issue86.class);
8080
assertEquals(before, after);
8181
}
82-
83-
8482
}

src/test/java/com/fasterxml/jackson/dataformat/xml/failing/TestUntypedListSerialization.java renamed to src/test/java/com/fasterxml/jackson/dataformat/xml/failing/UntypedListSerialization8Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
99
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
1010

11-
public class TestUntypedListSerialization extends XmlTestBase
11+
public class UntypedListSerialization8Test extends XmlTestBase
1212
{
1313
@JacksonXmlRootElement(localName="L")
1414
static class UntypedListBean

0 commit comments

Comments
 (0)