/
githubmirror
/
RxJava
Обзор
Документация
Войти
/
githubmirror
/
RxJava
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.x
src/test/java/io/reactivex/rxjava4/exceptions/OnErrorNotImplementedExceptionTest.java
136 строк
4 KB
David Karnok
4.x: Convert from JUnit 4 to JUnit 6 (#8202)
30 июн 2026, 12:01
Не верифицирован
30 июн 2026, 12:01
531388f
Код
Авторство
О чём код?
/* * Copyright (c) 2016-present, RxJava Contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See * the License for the specific language governing permissions and limitations under the License. */ package io.reactivex.rxjava4.exceptions; import static org.junit.jupiter.api.Assertions.*; import java.util.List; import org.junit.jupiter.api.*; import io.reactivex.rxjava4.core.*; import io.reactivex.rxjava4.internal.functions.Functions; import io.reactivex.rxjava4.plugins.RxJavaPlugins; import io.reactivex.rxjava4.testsupport.TestHelper; public class OnErrorNotImplementedExceptionTest extends RxJavaTest { List<Throwable> errors; @BeforeEach public void before() { errors = TestHelper.trackPluginErrors(); } @AfterEach public void after() { RxJavaPlugins.reset(); assertFalse(errors.isEmpty(), "" + errors); TestHelper.assertError(errors, 0, OnErrorNotImplementedException.class); Throwable c = errors.getFirst().getCause(); assertTrue(c instanceof TestException, "" + c); } @Test public void flowableSubscribe0() { Flowable.error(new TestException()) .subscribe(); } @Test public void flowableSubscribe1() { Flowable.error(new TestException()) .subscribe(Functions.emptyConsumer()); } @Test public void flowableForEachWhile() { Flowable.error(new TestException()) .forEachWhile(Functions.alwaysTrue()); } @Test public void flowableBlockingSubscribe1() { Flowable.error(new TestException()) .blockingSubscribe(Functions.emptyConsumer()); } @Test public void flowableBoundedBlockingSubscribe1() { Flowable.error(new TestException()) .blockingSubscribe(Functions.emptyConsumer(), 128); } @Test public void observableSubscribe0() { Observable.error(new TestException()) .subscribe(); } @Test public void observableSubscribe1() { Observable.error(new TestException()) .subscribe(Functions.emptyConsumer()); } @Test public void observableForEachWhile() { Observable.error(new TestException()) .forEachWhile(Functions.alwaysTrue()); } @Test public void observableBlockingSubscribe1() { Observable.error(new TestException()) .blockingSubscribe(Functions.emptyConsumer()); } @Test public void singleSubscribe0() { Single.error(new TestException()) .subscribe(); } @Test public void singleSubscribe1() { Single.error(new TestException()) .subscribe(Functions.emptyConsumer()); } @Test public void maybeSubscribe0() { Maybe.error(new TestException()) .subscribe(); } @Test public void maybeSubscribe1() { Maybe.error(new TestException()) .subscribe(Functions.emptyConsumer()); } @Test public void completableSubscribe0() { Completable.error(new TestException()) .subscribe(); } @Test public void completableSubscribe1() { Completable.error(new TestException()) .subscribe(Functions.EMPTY_ACTION); } }