File tree 2 files changed +12
-1
lines changed
main/java/org/springframework/test/util
test/java/org/springframework/test/util
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ public boolean hasDifferences() {
110
110
111
111
@ Override
112
112
public String toString () {
113
- return this .diff .toString ();
113
+ return this .diff .fullDescription ();
114
114
}
115
115
116
116
}
Original file line number Diff line number Diff line change @@ -74,4 +74,15 @@ void assertXmlEqualExceptionForLessEntries() {
74
74
.withMessageContaining ("Expected child nodelist length '3' but was '2'" );
75
75
}
76
76
77
+ @ Test
78
+ void assertXmlEqualExceptionWithFullDescription () {
79
+ String control = "<root><field1>f1</field1><field2>f2</field2></root>" ;
80
+ String test = "<root><field2>f2</field2><field3>f3</field3></root>" ;
81
+ XmlExpectationsHelper xmlHelper = new XmlExpectationsHelper ();
82
+ assertThatExceptionOfType (AssertionError .class ).isThrownBy (() ->
83
+ xmlHelper .assertXmlEqual (control , test ))
84
+ .withMessageContaining ("Expected child 'field1' but was 'null'" )
85
+ .withMessageContaining ("Expected child 'null' but was 'field3'" );
86
+ }
87
+
77
88
}
You can’t perform that action at this time.
0 commit comments