A simple JUnit Test:
assertThat("not empty", both(Matchers.isEmptyString()).and(CompareMatcher.isIdenticalTo("")));
And this throws an NPE:
java.lang.NullPointerException
at org.xmlunit.matchers.CompareMatcher.firstComparison(CompareMatcher.java:336)
at org.xmlunit.matchers.CompareMatcher.describeTo(CompareMatcher.java:307)
at org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:24)
at org.hamcrest.BaseDescription.appendList(BaseDescription.java:94)
at org.hamcrest.BaseDescription.appendList(BaseDescription.java:85)
at org.hamcrest.core.AllOf.describeTo(AllOf.java:38)
at org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:24)
at org.hamcrest.core.CombinableMatcher.describeTo(CombinableMatcher.java:25)
at org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:24)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:14)
at org.junit.Assert.assertThat(Assert.java:956)
at org.junit.Assert.assertThat(Assert.java:923)
A simple JUnit Test:
assertThat("not empty", both(Matchers.isEmptyString()).and(CompareMatcher.isIdenticalTo("")));And this throws an NPE:
java.lang.NullPointerException
at org.xmlunit.matchers.CompareMatcher.firstComparison(CompareMatcher.java:336)
at org.xmlunit.matchers.CompareMatcher.describeTo(CompareMatcher.java:307)
at org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:24)
at org.hamcrest.BaseDescription.appendList(BaseDescription.java:94)
at org.hamcrest.BaseDescription.appendList(BaseDescription.java:85)
at org.hamcrest.core.AllOf.describeTo(AllOf.java:38)
at org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:24)
at org.hamcrest.core.CombinableMatcher.describeTo(CombinableMatcher.java:25)
at org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:24)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:14)
at org.junit.Assert.assertThat(Assert.java:956)
at org.junit.Assert.assertThat(Assert.java:923)