public boolean matches(Object argument) { return this.matcher.matches(argument); }
@Override protected boolean matchesSafely(T item) { return throwableMatcher.matches(item); }
private boolean safelyMatches(Matcher m, Object arg) { try { return m.matches(arg); } catch (Throwable t) { return false; } }
@Override protected boolean matchesSafely(T item) { return causeMatcher.matches(item.getCause()); }
@Override protected boolean matchesSafely(T item) { return matcher.matches(item.getMessage()); }
@Override public boolean matches(Object item) { Throwable cause = null; if (item != null && item instanceof Throwable) { cause = ((Throwable)item).getCause(); } return matcher.matches(cause); }
@Override protected boolean matchesSafely( Iterable<T> items ) { for ( T item : items ) { if ( itemMatcher.matches( item ) ) { return true; } } return false; }
protected boolean matches( LogCall logCall ) { return logCall != null && contextMatcher.matches( logCall.context ) && levelMatcher.matches( logCall.level ) && messageMatcher.matches( logCall.message ) && argumentsMatcher.matches( logCall.arguments ) && throwableMatcher.matches( logCall.throwable ); }
@Override protected boolean matchesSafely( Iterable<T> items ) { for ( T item : items ) { if ( itemMatcher.matches( item ) ) { return false; } } return true; }
@Override public boolean matching(Matcher<T> matcher, String message) { if (matcher.matches(theValue)) { return true; } mismatch.appendText(message); matcher.describeMismatch(theValue, mismatch); return false; }
@Override protected boolean matchesSafely(T item, Description mismatch) { if (!matcher.matches(item)) { matcher.describeMismatch(item, mismatch); return false; } return true; }
@Override protected boolean matchesSafely(T actual, Description mismatch) { final U featureValue = featureValueOf(actual); if (!subMatcher.matches(featureValue)) { mismatch.appendText(featureName).appendText(" "); subMatcher.describeMismatch(featureValue, mismatch); return false; } return true; };
@Override protected boolean matchesSafely( Throwable throwable ) { return matcher.matches( throwable.getMessage() ); }
@Override protected boolean matchesSafely( Exception item ) { return message.matches( item.getMessage() ); }
@Override public boolean matchesSafely(PrintableResult item) { return item.failureCount() == 1 && matcher.matches(item.failures().get(0).getException()); }
@Override public boolean matchesSafely(final RingBuffer<Object[]> ringBuffer) { boolean matches = true; for (int i = 0; i < expectedValueMatchers.length; i++) { final Matcher<?> expectedValueMatcher = expectedValueMatchers[i]; matches &= expectedValueMatcher.matches(ringBuffer.get(i)[0]); } return matches; }
public <T> DescriptionBuilder expectThat(String reason, T actual, Matcher<? super T> matcher) { if (!matcher.matches(actual)) { addError(reason, actual, matcher); } return this; }
@Override protected boolean matchesSafely(StreamRecord<? extends WindowedValue<? extends T, ? extends W>> streamRecord) { return valueMatcher.matches(streamRecord.getValue().value()) && timestampMatcher.matches(streamRecord.getTimestamp()) && windowMatcher.matches(streamRecord.getValue().window()); } }