public class AssertSingle<T> extends org.assertj.core.api.AbstractAssert<AssertSingle<T>,io.reactivex.Single<T>>
Assert class for Single.
Uses TestSubscriber from Rx to subscribe to Single and
perform assertions on the results.| Modifier and Type | Method and Description |
|---|---|
AssertSingle<T> |
after(long duration,
java.util.concurrent.TimeUnit timeUnit)
If a
TestScheduler is provided, advanced the time by the specified duration. |
static <T> AssertSingle<T> |
assertThat(io.reactivex.Single<T> single)
Create an
AssertSingle instance for a Single. |
static <T> AssertSingle<T> |
assertThat(io.reactivex.Single<T> single,
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 from the error(s) emitted by the Single. |
AssertSingle<T> |
hasCompleted()
Assert that the
Single has completed. |
AssertSingle<T> |
hasNotCompleted()
Assert that the
Single has *not* completed. |
org.assertj.core.api.AbstractObjectAssert<?,? extends T> |
value()
Create an
ObjectAssert from the value emitted by the Single. |
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> AssertSingle<T> assertThat(io.reactivex.Single<T> single)
AssertSingle instance for a Single.T - the return type of the Singlesingle - the Single.public static <T> AssertSingle<T> assertThat(io.reactivex.Single<T> single, io.reactivex.schedulers.TestScheduler scheduler)
T - the return type of the Singlesingle - the singlescheduler - the test schedulerpublic org.assertj.core.api.AbstractObjectAssert<?,? extends T> value()
ObjectAssert from the value emitted by the Single.public org.assertj.core.api.AbstractListAssert<?,? extends java.util.List<? extends java.lang.Throwable>,java.lang.Throwable> failures()
ListAssert from the error(s) emitted by the Single.public AssertSingle<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 AssertSingle(Single, TestScheduler) to construct
an AssertSingle instance that can be used for async testing.duration - the time durationtimeUnit - the time unit of the durationjava.lang.IllegalStateException - if called when no test scheduler was providedpublic AssertSingle<T> hasCompleted()
Single has completed.public AssertSingle<T> hasNotCompleted()
Single has *not* completed.