MCPcopy Index your code
hub / github.com/ReactiveX/RxJavaAsyncUtil / testAction1

Method testAction1

src/test/java/rx/util/async/AsyncTest.java:114–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112 }
113
114 @Test
115 public void testAction1() {
116 final AtomicInteger value = new AtomicInteger();
117 Action1<Integer> action = new Action1<Integer>() {
118 @Override
119 public void call(Integer t1) {
120 value.set(t1);
121 }
122 };
123
124 Async.toAsync(action, Schedulers.immediate())
125 .call(1)
126 .subscribe(new TestObserver<Object>(observer));
127
128 verify(observer, never()).onError(any(Throwable.class));
129 verify(observer, times(1)).onNext(null);
130 verify(observer, times(1)).onCompleted();
131
132 Assert.assertEquals(1, value.get());
133 }
134
135 @Test
136 public void testAction1Error() {

Callers

nothing calls this directly

Calls 5

toAsyncMethod · 0.95
callMethod · 0.45
onErrorMethod · 0.45
onNextMethod · 0.45
onCompletedMethod · 0.45

Tested by

no test coverage detected