RxTestkit

AssertJ for RxJava

Лицензия

Лицензия

Категории

Категории

Java Языки программирования
Группа

Группа

com.github.hyleung
Идентификатор

Идентификатор

rx-testkit-java
Последняя версия

Последняя версия

2.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

RxTestkit
AssertJ for RxJava
Ссылка на сайт

Ссылка на сайт

http://hyleung.github.io/rx-testkit/
Система контроля версий

Система контроля версий

https://github.com/hyleung/rx-testkit.git

Скачать rx-testkit-java

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.hyleung/rx-testkit-java/ -->
<dependency>
    <groupId>com.github.hyleung</groupId>
    <artifactId>rx-testkit-java</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.hyleung/rx-testkit-java/
implementation 'com.github.hyleung:rx-testkit-java:2.0.0'
// https://jarcasting.com/artifacts/com.github.hyleung/rx-testkit-java/
implementation ("com.github.hyleung:rx-testkit-java:2.0.0")
'com.github.hyleung:rx-testkit-java:jar:2.0.0'
<dependency org="com.github.hyleung" name="rx-testkit-java" rev="2.0.0">
  <artifact name="rx-testkit-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.hyleung', module='rx-testkit-java', version='2.0.0')
)
libraryDependencies += "com.github.hyleung" % "rx-testkit-java" % "2.0.0"
[com.github.hyleung/rx-testkit-java "2.0.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.assertj : assertj-core jar 2.2.0
io.reactivex.rxjava2 : rxjava jar 2.0.0
org.slf4j : slf4j-api jar 1.7.5

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.spockframework : spock-core jar 1.0-groovy-2.4
org.mockito : mockito-core jar 1.10.19
org.codehaus.groovy : groovy-all jar 2.4.4

Модули Проекта

Данный проект не имеет модулей.

#RX TestKit: AssertJ for RxJava Build Status

This library provides a set of AssertJ assertions that can be used to make unit testing of RxJava code a little easier.

RxJava 2.x

via Maven:

<dependency>
    <groupId>com.github.hyleung</groupId>
    <artifactId>rx-testkit-java</artifactId>
    <version>2.0.0</version>
    <scope>test</scope>
</dependency>

via Gradle

test 'com.github.hyleung:rx-testkit-java:2.0.0'

RxJava 1.x

For RxJava 1.x, the latest release of this library is 1.1.0.

via Maven:

<dependency>
    <groupId>com.github.hyleung</groupId>
    <artifactId>rx-testkit-java</artifactId>
    <version>1.1.0</version>
    <scope>test</scope>
</dependency>

via Gradle

test 'com.github.hyleung:rx-testkit-java:1.1.0'

##Examples:

Assert that an Observable has completed…

Observable<String> observable = Observable.just("foo");

assertThat(observable)
    .hasCompleted();

…or hasn't completed:

Observable<String> observable = Observable.just("foo");

assertThat(observable)
    .hasNotCompleted();

…or has values (returns an AbstractListAssert)

Observable<String> observable = Observable.just("foo");

assertThat(observable)
    .values()
    .contains("foo");

…or emits a certain error (also returns an AbstractListAssert)

Exception myException = new Exception();

Observable<String> observable = Observable.error(myException);

assertThat(observable)
    .failures()
    .contains(myException);

...or mess around with time using a TestScheduler:

 TestScheduler scheduler = new TestScheduler();
 Observable<Integer> observable = Observable.just(1).delay(99, TimeUnit.MILLISECONDS, scheduler);

 assertThat(observable, scheduler)
         .after(100, TimeUnit.MILLISECONDS)
         .values()
         .isNotEmpty();

There's also support for rx.Single and rx.Completable.

Версии библиотеки

Версия
2.0.0
1.1.0
1.0.0