@Override public final void describeTo(Description description) { description.appendText(featureDescription).appendText(" ") .appendDescriptionOf(subMatcher); } }
@Override public void describeTo(Description description) { description.appendText("sameInstance(") .appendValue(object) .appendText(")"); }
@Override public void describeTo(Description description) { description.appendText("hasProperty(").appendValue(propertyName).appendText(", ") .appendDescriptionOf(valueMatcher).appendText(")"); }
private void describeMismatch(Matcher<? super F> matcher, F item) { mismatchDescription.appendText("item " + nextMatchIx + ": "); matcher.describeMismatch(item, mismatchDescription); } }
@Override public boolean matches(Object o, Description mismatch) { for (Matcher<? super T> matcher : matchers) { if (!matcher.matches(o)) { mismatch.appendDescriptionOf(matcher).appendText(" "); matcher.describeMismatch(o, mismatch); return false; } } return true; }
@Override public void describeTo(Description description) { description.appendText("sameInstance(") .appendValue(object) .appendText(")"); }
@Override public void describeTo(Description description) { description.appendText("an XML document with XPath ").appendText(xpathString); if (valueMatcher != null) { description.appendText(" ").appendDescriptionOf(valueMatcher); } }
@Override protected void describeMismatchSafely(T item, Description description) { description.appendText("cause "); causeMatcher.describeMismatch(item.getCause(), description); }
public void describeTo(Description description) { if (fAssumption != null) { description.appendText(fAssumption); } if (fValueMatcher) { // a value was passed in when this instance was constructed; print it if (fAssumption != null) { description.appendText(": "); } description.appendText("got: "); description.appendValue(fValue); if (fMatcher != null) { description.appendText(", expected: "); description.appendDescriptionOf(fMatcher); } } } }
public static <T> void assertThat(String reason, T actual, Matcher<? super T> matcher) { if (!matcher.matches(actual)) { Description description = new StringDescription(); description.appendText(reason) .appendText("\nExpected: ") .appendDescriptionOf(matcher) .appendText("\n but: "); matcher.describeMismatch(actual, description); throw new AssertionError(description.toString()); } }
@Override public void describeTo(Description description) { description.appendText("equalToIgnoringCase(") .appendValue(string) .appendText(")"); }
@Override public final void describeTo(Description description) { description.appendText(featureDescription).appendText(" ") .appendDescriptionOf(subMatcher); } }
@Override protected void describeMismatchSafely(T item, Description description) { description.appendText("message "); matcher.describeMismatch(item.getMessage(), description); }
public void describeTo(Description description) { description .appendText("with json path ") .appendValue(jsonPath.getPath()) .appendText(" evaluated to ") .appendDescriptionOf(resultMatcher); }
@Override public boolean matches(Object o, Description mismatch) { for (Matcher<? super T> matcher : matchers) { if (!matcher.matches(o)) { mismatch.appendDescriptionOf(matcher).appendText(" "); matcher.describeMismatch(o, mismatch); return false; } } return true; }
@Override public void describeTo(Description description) { description .appendText("a diagnostic on line ") .appendValue(line) .appendText(" that matches \n") .appendValue(matcher) .appendText("\n"); } };
public void describeTo(Description description) { description.appendText("exception with message "); description.appendDescriptionOf(matcher); }
@Override protected void describeMismatchSafely(T item, Description description) { description.appendText("cause "); fMatcher.describeMismatch(item.getCause(), description); }
@Override public void describeTo( Description target ) { target.appendText( "Notification{code=" ).appendValue( code ) .appendText( ", description=[" ).appendDescriptionOf( description ) .appendText( "], position=[" ).appendDescriptionOf( position ) .appendText( "], severity=" ).appendValue( severity ) .appendText( "}" ); } };
public static <T> void assertThat(String reason, T actual, Matcher<? super T> matcher) { if (!matcher.matches(actual)) { Description description = new StringDescription(); description.appendText(reason) .appendText("\nExpected: ") .appendDescriptionOf(matcher) .appendText("\n but: "); matcher.describeMismatch(actual, description); throw new AssertionError(description.toString()); } }