public class AssertObservable<T> extends org.assertj.core.api.AbstractAssert<AssertObservable<T>,io.reactivex.Observable<T>>
Assert class for Observable.
Uses TestSubscriber from Rx to subscribe to and Observable and
perform assertions on the results.
Optionally, a TestScheduler can be used to perform async testing.| Modifier and Type | Method and Description |
|---|---|
AssertObservable<T> |
after(long duration,
java.util.concurrent.TimeUnit timeUnit)
If a
TestScheduler is provided, advanced the time by the specified duration. |
static <T> AssertObservable<T> |
assertThat(io.reactivex.Observable<T> observable)
Constructs an
AssertObservable for a given Observable. |
static <T> AssertObservable<T> |
assertThat(io.reactivex.Observable<T> observable,
io.reactivex.schedulers.TestScheduler scheduler)
|
org.assertj.core.api.AbstractListAssert<?,? extends java.util.List<? extends java.lang.Throwable>,java.lang.Throwable> |
failures()
Create a
ListAssert for the failures emitted. |
AssertObservable<T> |
hasCompleted()
Assert that the underlying
Observable has completed. |
AssertObservable<T> |
hasNotCompleted()
Assert that the underlying
Observable has *not* completed. |
org.assertj.core.api.AbstractListAssert<?,? extends java.util.List<? extends T>,T> |
values()
Create a
ListAssert for the values emitted. |
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage, usingComparator, usingDefaultComparator, withFailMessage, withThreadDumpOnErrorpublic static <T> AssertObservable<T> assertThat(io.reactivex.Observable<T> observable)
AssertObservable for a given Observable.T - the return type of the Observableobservable - the Observable to perform assertions on.public static <T> AssertObservable<T> assertThat(io.reactivex.Observable<T> observable, io.reactivex.schedulers.TestScheduler scheduler)
T - the return type of the Observableobservable - the Observable.scheduler - the test scheduler to usepublic AssertObservable<T> hasCompleted()
Observable has completed.public AssertObservable<T> hasNotCompleted()
Observable has *not* completed.public org.assertj.core.api.AbstractListAssert<?,? extends java.util.List<? extends T>,T> values()
ListAssert for the values emitted.public org.assertj.core.api.AbstractListAssert<?,? extends java.util.List<? extends java.lang.Throwable>,java.lang.Throwable> failures()
ListAssert for the failures emitted.public AssertObservable<T> after(long duration, java.util.concurrent.TimeUnit timeUnit)
TestScheduler is provided, advanced the time by the specified duration.
Throws an IllegalStateException if there is no TestScheduler provided.
Use AssertObservable(Observable, TestScheduler) to construct
an AssertObservable instance that can be used for async testing.duration - the time durationtimeUnit - the time unit of the duration