T - the type of value to matchpublic class FutureMatcher<T> extends org.hamcrest.TypeSafeDiagnosingMatcher<CompletableFuture<? super T>>
Matcher for values provided by CompletableFutures.
Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
| Constructor and Description |
|---|
FutureMatcher(org.hamcrest.Matcher<? super T> matcher)
Constructs a
FutureMatcher |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(org.hamcrest.Description description) |
static <T> org.hamcrest.Matcher<T> |
futureOf(org.hamcrest.Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests
to be slightly more expressive.
|
static <T> org.hamcrest.Matcher<T> |
futureOf(T value)
A shortcut to the frequently used
is(equalTo(x)). |
protected boolean |
matchesSafely(CompletableFuture<? super T> item,
org.hamcrest.Description mismatchDescription) |
public FutureMatcher(org.hamcrest.Matcher<? super T> matcher)
FutureMatchermatcher - the Matcher of a future valueprotected boolean matchesSafely(CompletableFuture<? super T> item, org.hamcrest.Description mismatchDescription)
matchesSafely in class org.hamcrest.TypeSafeDiagnosingMatcher<CompletableFuture<? super T>>public void describeTo(org.hamcrest.Description description)
public static <T> org.hamcrest.Matcher<T> futureOf(org.hamcrest.Matcher<T> matcher)
For example:
assertThat(cheese, is(equalTo(smelly)))instead of:
assertThat(cheese, equalTo(smelly))
T - the type of the valuematcher - the value MatcherMatcherpublic static <T> org.hamcrest.Matcher<T> futureOf(T value)
is(equalTo(x)).
For example:
assertThat(cheese, is(smelly))instead of:
assertThat(cheese, is(equalTo(smelly)))
T - the type of the valuevalue - the valueMatcherCopyright © 2017. All rights reserved.