You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of our integration tests fails with a NoSuchElementException escaping from CompareMatcher#describeTo(Description). We use org.xmlunit:xmlunit-matchers:2.5.0.
In the debugger, I can see that the matcher's diffResult is != null, but diffResult.hasDifferences() == false. Since describeTo(Description) only checks for diffResult == null, the code flow enters ComparisonMatcher#firstComparison() where the subexpression diffResult.getDifferences().iterator().next() throws the NoSuchElementException.
The fix seems easy: Simply test for diffResult == null || !diffResult.hasDifferences() at the beginning of CompareMatcher#describeTo(Description).
The text was updated successfully, but these errors were encountered:
One of our integration tests fails with a
NoSuchElementException
escaping fromCompareMatcher#describeTo(Description)
. We use org.xmlunit:xmlunit-matchers:2.5.0.In the debugger, I can see that the matcher's
diffResult
is!= null
, butdiffResult.hasDifferences() == false
. SincedescribeTo(Description)
only checks fordiffResult == null
, the code flow entersComparisonMatcher#firstComparison()
where the subexpressiondiffResult.getDifferences().iterator().next()
throws theNoSuchElementException
.The fix seems easy: Simply test for
diffResult == null || !diffResult.hasDifferences()
at the beginning ofCompareMatcher#describeTo(Description)
.The text was updated successfully, but these errors were encountered: