MCPcopy Index your code
hub / github.com/ReactiveX/RxJava / basic

Method basic

src/test/java/io/reactivex/rxjava3/maybe/MaybeTest.java:1416–1444  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1414 }
1415
1416 @Test
1417 public void basic() {
1418 List<Throwable> errors = TestHelper.trackPluginErrors();
1419 try {
1420 final Disposable d = Disposable.empty();
1421
1422 Maybe.<Integer>create(new MaybeOnSubscribe<Integer>() {
1423 @Override
1424 public void subscribe(MaybeEmitter<Integer> e) throws Exception {
1425 e.setDisposable(d);
1426
1427 e.onSuccess(1);
1428 e.onError(new TestException());
1429 e.onSuccess(2);
1430 e.onError(new TestException());
1431 e.onComplete();
1432 }
1433 })
1434 .test()
1435 .assertResult(1);
1436
1437 assertTrue(d.isDisposed());
1438
1439 TestHelper.assertUndeliverable(errors, 0, TestException.class);
1440 TestHelper.assertUndeliverable(errors, 1, TestException.class);
1441 } finally {
1442 RxJavaPlugins.reset();
1443 }
1444 }
1445
1446 @Test
1447 public void basicWithError() {

Callers

nothing calls this directly

Calls 8

trackPluginErrorsMethod · 0.95
emptyMethod · 0.95
createMethod · 0.95
isDisposedMethod · 0.95
assertUndeliverableMethod · 0.95
resetMethod · 0.95
testMethod · 0.65
assertResultMethod · 0.45

Tested by

no test coverage detected