The following issues were found

src/test/java/io/reactivex/rxjava3/internal/jdk8/FlowableFromStreamTest.java
192 issues
This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.jdk8;

import static org.junit.Assert.*;

import java.util.*;
import java.util.concurrent.*;

            

Reported by PMD.

The class 'FlowableFromStreamTest' has a Modified Cyclomatic Complexity of 2 (Highest = 11).
Design

Line: 33

              import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableFromStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.fromStream(Stream.<Integer>of())
        .test()

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 33

              import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableFromStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.fromStream(Stream.<Integer>of())
        .test()

            

Reported by PMD.

The class 'FlowableFromStreamTest' has a Standard Cyclomatic Complexity of 2 (Highest = 11).
Design

Line: 33

              import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableFromStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.fromStream(Stream.<Integer>of())
        .test()

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 36

              public class FlowableFromStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.fromStream(Stream.<Integer>of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void empty() {
        Flowable.fromStream(Stream.<Integer>of())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void empty() {
        Flowable.fromStream(Stream.<Integer>of())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 43

                  }

    @Test
    public void just() {
        Flowable.fromStream(Stream.<Integer>of(1))
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 44

              
    @Test
    public void just() {
        Flowable.fromStream(Stream.<Integer>of(1))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 44

              
    @Test
    public void just() {
        Flowable.fromStream(Stream.<Integer>of(1))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeDelayErrorTest.java
190 issues
Avoid throwing raw exception types.
Design

Line: 152

                          f3.t.join();
            f4.t.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        verify(stringSubscriber, times(1)).onNext("one");
        verify(stringSubscriber, times(1)).onNext("two");
        verify(stringSubscriber, times(1)).onNext("three");

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 284

                          f1.t.join();
            f2.t.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        verify(stringSubscriber, never()).onError(any(Throwable.class));
        verify(stringSubscriber, times(2)).onNext("hello");
        verify(stringSubscriber, times(1)).onComplete();

            

Reported by PMD.

System.out.println is used
Design

Line: 364

                          boolean errorThrown = false;
            for (String s : valuesToReturn) {
                if (s == null) {
                    System.out.println("throwing exception");
                    subscriber.onError(new NullPointerException());
                    errorThrown = true;
                    // purposefully not returning here so it will continue calling onNext
                    // so that we also test that we handle bad sequences like this
                } else {

            

Reported by PMD.

System.out.println is used
Design

Line: 398

                              public void run() {
                    for (String s : valuesToReturn) {
                        if (s == null) {
                            System.out.println("throwing exception");
                            try {
                                Thread.sleep(100);
                            } catch (Throwable e) {

                            }

            

Reported by PMD.

System.out.println is used
Design

Line: 410

                                          subscriber.onNext(s);
                        }
                    }
                    System.out.println("subscription complete");
                    subscriber.onComplete();
                }

            });
            t.start();

            

Reported by PMD.

System.out.println is used
Design

Line: 473

                          TestSubscriberEx<String> ts = new TestSubscriberEx<>(stringSubscriber);
            Flowable<String> m = Flowable.mergeDelayError(parentFlowable);
            m.subscribe(ts);
            System.out.println("testErrorInParentFlowableDelayed | " + i);
            ts.awaitDone(2000, TimeUnit.MILLISECONDS);
            ts.assertTerminated();

            verify(stringSubscriber, times(2)).onNext("hello");
            verify(stringSubscriber, times(1)).onError(any(NullPointerException.class));

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.operators.flowable;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;


            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 34

              import io.reactivex.rxjava3.subscribers.*;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableMergeDelayErrorTest extends RxJavaTest {

    Subscriber<String> stringSubscriber;

    @Before
    public void before() {

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 36

              
public class FlowableMergeDelayErrorTest extends RxJavaTest {

    Subscriber<String> stringSubscriber;

    @Before
    public void before() {
        stringSubscriber = TestHelper.mockSubscriber();
    }

            

Reported by PMD.

The String literal 'four' appears 13 times in this file; the first occurrence is on line 45
Error

Line: 45

              
    @Test
    public void errorDelayed1() {
        final Flowable<String> f1 = Flowable.unsafeCreate(new TestErrorFlowable("four", null, "six")); // we expect to lose "six" from the source (and it should never be sent by the source since onError was called
        final Flowable<String> f2 = Flowable.unsafeCreate(new TestErrorFlowable("one", "two", "three"));

        Flowable<String> m = Flowable.mergeDelayError(f1, f2);
        m.subscribe(stringSubscriber);


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeTimeoutTest.java
187 issues
This class has too many methods, consider refactoring it.
Design

Line: 33

              import io.reactivex.rxjava3.subjects.MaybeSubject;
import io.reactivex.rxjava3.testsupport.*;

public class MaybeTimeoutTest extends RxJavaTest {

    @Test
    public void normal() {
        Maybe.just(1)
        .timeout(1, TimeUnit.DAYS)

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 36

              public class MaybeTimeoutTest extends RxJavaTest {

    @Test
    public void normal() {
        Maybe.just(1)
        .timeout(1, TimeUnit.DAYS)
        .test()
        .assertResult(1);
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void normal() {
        Maybe.just(1)
        .timeout(1, TimeUnit.DAYS)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void normal() {
        Maybe.just(1)
        .timeout(1, TimeUnit.DAYS)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void normal() {
        Maybe.just(1)
        .timeout(1, TimeUnit.DAYS)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 44

                  }

    @Test
    public void normalMaybe() {
        Maybe.just(1)
        .timeout(Maybe.timer(1, TimeUnit.DAYS))
        .test()
        .assertResult(1);
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 45

              
    @Test
    public void normalMaybe() {
        Maybe.just(1)
        .timeout(Maybe.timer(1, TimeUnit.DAYS))
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 45

              
    @Test
    public void normalMaybe() {
        Maybe.just(1)
        .timeout(Maybe.timer(1, TimeUnit.DAYS))
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 45

              
    @Test
    public void normalMaybe() {
        Maybe.just(1)
        .timeout(Maybe.timer(1, TimeUnit.DAYS))
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 52

                  }

    @Test
    public void never() {
        Maybe.never()
        .timeout(1, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertFailure(TimeoutException.class);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableSkipLastTimedTest.java
187 issues
This class has too many methods, consider refactoring it.
Design

Line: 32

              import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableSkipLastTimedTest extends RxJavaTest {

    @Test
    public void skipLastTimed() {
        TestScheduler scheduler = new TestScheduler();


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 41

                      PublishSubject<Integer> source = PublishSubject.create();

        // FIXME the timeunit now matters due to rounding
        Observable<Integer> result = source.skipLast(1000, TimeUnit.MILLISECONDS, scheduler);

        Observer<Object> o = TestHelper.mockObserver();

        result.subscribe(o);


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 45

              
        Observer<Object> o = TestHelper.mockObserver();

        result.subscribe(o);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 47

              
        result.subscribe(o);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(500, TimeUnit.MILLISECONDS);


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 48

                      result.subscribe(o);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(500, TimeUnit.MILLISECONDS);

        source.onNext(4);

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 49

              
        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(500, TimeUnit.MILLISECONDS);

        source.onNext(4);
        source.onNext(5);

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 53

              
        scheduler.advanceTimeBy(500, TimeUnit.MILLISECONDS);

        source.onNext(4);
        source.onNext(5);
        source.onNext(6);

        scheduler.advanceTimeBy(950, TimeUnit.MILLISECONDS);
        source.onComplete();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 54

                      scheduler.advanceTimeBy(500, TimeUnit.MILLISECONDS);

        source.onNext(4);
        source.onNext(5);
        source.onNext(6);

        scheduler.advanceTimeBy(950, TimeUnit.MILLISECONDS);
        source.onComplete();


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 55

              
        source.onNext(4);
        source.onNext(5);
        source.onNext(6);

        scheduler.advanceTimeBy(950, TimeUnit.MILLISECONDS);
        source.onComplete();

        InOrder inOrder = inOrder(o);

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 58

                      source.onNext(6);

        scheduler.advanceTimeBy(950, TimeUnit.MILLISECONDS);
        source.onComplete();

        InOrder inOrder = inOrder(o);
        inOrder.verify(o).onNext(1);
        inOrder.verify(o).onNext(2);
        inOrder.verify(o).onNext(3);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatMapEagerTest.java
181 issues
This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.operators.observable;

import static org.junit.Assert.*;

import java.lang.reflect.Method;
import java.util.*;

            

Reported by PMD.

Avoid really long classes.
Design

Line: 36

              import io.reactivex.rxjava3.subjects.*;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableConcatMapEagerTest extends RxJavaTest {

    @Test
    public void normal() {
        Observable.range(1, 5)
        .concatMapEager(new Function<Integer, ObservableSource<Integer>>() {

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 36

              import io.reactivex.rxjava3.subjects.*;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableConcatMapEagerTest extends RxJavaTest {

    @Test
    public void normal() {
        Observable.range(1, 5)
        .concatMapEager(new Function<Integer, ObservableSource<Integer>>() {

            

Reported by PMD.

Possible God Class (WMC=69, ATFD=55, TCC=5.328%)
Design

Line: 36

              import io.reactivex.rxjava3.subjects.*;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableConcatMapEagerTest extends RxJavaTest {

    @Test
    public void normal() {
        Observable.range(1, 5)
        .concatMapEager(new Function<Integer, ObservableSource<Integer>>() {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 90

                                  }
                }, false).to(TestHelper.<Integer>testConsumer());

        main.onNext(1);

        inner.onNext(2);

        to.assertValue(2);


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 92

              
        main.onNext(1);

        inner.onNext(2);

        to.assertValue(2);

        main.onError(new TestException("Forced failure"));


            

Reported by PMD.

The String literal 'Forced failure' appears 6 times in this file; the first occurrence is on line 96
Error

Line: 96

              
        to.assertValue(2);

        main.onError(new TestException("Forced failure"));

        to.assertNoErrors();

        inner.onNext(3);
        inner.onComplete();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 100

              
        to.assertNoErrors();

        inner.onNext(3);
        inner.onComplete();

        to.assertFailureAndMessage(TestException.class, "Forced failure", 2, 3);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 101

                      to.assertNoErrors();

        inner.onNext(3);
        inner.onComplete();

        to.assertFailureAndMessage(TestException.class, "Forced failure", 2, 3);
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 119

                                  }
                }, true).to(TestHelper.<Integer>testConsumer());

        main.onNext(1);
        main.onNext(2);

        inner.onNext(2);

        to.assertValue(2);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableSampleTest.java
180 issues
This class has too many methods, consider refactoring it.
Design

Line: 33

              import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableSampleTest extends RxJavaTest {
    private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;
    private Observer<Long> observer;
    private Observer<Object> observer2;


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 34

              import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableSampleTest extends RxJavaTest {
    private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;
    private Observer<Long> observer;
    private Observer<Object> observer2;

    @Before

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 35

              
public class ObservableSampleTest extends RxJavaTest {
    private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;
    private Observer<Long> observer;
    private Observer<Object> observer2;

    @Before
    // due to mocking

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 36

              public class ObservableSampleTest extends RxJavaTest {
    private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;
    private Observer<Long> observer;
    private Observer<Object> observer2;

    @Before
    // due to mocking
    public void before() {

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 37

                  private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;
    private Observer<Long> observer;
    private Observer<Object> observer2;

    @Before
    // due to mocking
    public void before() {
        scheduler = new TestScheduler();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 76

                      });

        Observable<Long> sampled = source.sample(400L, TimeUnit.MILLISECONDS, scheduler);
        sampled.subscribe(observer);

        InOrder inOrder = inOrder(observer);

        scheduler.advanceTimeTo(800L, TimeUnit.MILLISECONDS);
        verify(observer, never()).onNext(any(Long.class));

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 81

                      InOrder inOrder = inOrder(observer);

        scheduler.advanceTimeTo(800L, TimeUnit.MILLISECONDS);
        verify(observer, never()).onNext(any(Long.class));
        verify(observer, never()).onComplete();
        verify(observer, never()).onError(any(Throwable.class));

        scheduler.advanceTimeTo(1200L, TimeUnit.MILLISECONDS);
        inOrder.verify(observer, times(1)).onNext(1L);

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 82

              
        scheduler.advanceTimeTo(800L, TimeUnit.MILLISECONDS);
        verify(observer, never()).onNext(any(Long.class));
        verify(observer, never()).onComplete();
        verify(observer, never()).onError(any(Throwable.class));

        scheduler.advanceTimeTo(1200L, TimeUnit.MILLISECONDS);
        inOrder.verify(observer, times(1)).onNext(1L);
        verify(observer, never()).onNext(2L);

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 83

                      scheduler.advanceTimeTo(800L, TimeUnit.MILLISECONDS);
        verify(observer, never()).onNext(any(Long.class));
        verify(observer, never()).onComplete();
        verify(observer, never()).onError(any(Throwable.class));

        scheduler.advanceTimeTo(1200L, TimeUnit.MILLISECONDS);
        inOrder.verify(observer, times(1)).onNext(1L);
        verify(observer, never()).onNext(2L);
        verify(observer, never()).onComplete();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 86

                      verify(observer, never()).onError(any(Throwable.class));

        scheduler.advanceTimeTo(1200L, TimeUnit.MILLISECONDS);
        inOrder.verify(observer, times(1)).onNext(1L);
        verify(observer, never()).onNext(2L);
        verify(observer, never()).onComplete();
        verify(observer, never()).onError(any(Throwable.class));

        scheduler.advanceTimeTo(1600L, TimeUnit.MILLISECONDS);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableDoOnEachTest.java
180 issues
Avoid throwing raw exception types.
Design

Line: 79

                          @Override
            public String apply(String s) {
                if ("fail".equals(s)) {
                    throw new RuntimeException("Forced Failure");
                }
                return s;
            }
        });


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 108

                          @Override
            public void accept(String s) {
                if ("fail".equals(s)) {
                    throw new RuntimeException("Forced Failure");
                }
            }
        });

        doOnEach.subscribe(subscribedSubscriber);

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.operators.flowable;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;


            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 39

              import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableDoOnEachTest extends RxJavaTest {

    Subscriber<String> subscribedSubscriber;
    Subscriber<String> sideEffectSubscriber;

    @Before

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 41

              
public class FlowableDoOnEachTest extends RxJavaTest {

    Subscriber<String> subscribedSubscriber;
    Subscriber<String> sideEffectSubscriber;

    @Before
    public void before() {
        subscribedSubscriber = TestHelper.mockSubscriber();

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 42

              public class FlowableDoOnEachTest extends RxJavaTest {

    Subscriber<String> subscribedSubscriber;
    Subscriber<String> sideEffectSubscriber;

    @Before
    public void before() {
        subscribedSubscriber = TestHelper.mockSubscriber();
        sideEffectSubscriber = TestHelper.mockSubscriber();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 53

                  @Test
    public void doOnEach() {
        Flowable<String> base = Flowable.just("a", "b", "c");
        Flowable<String> doOnEach = base.doOnEach(sideEffectSubscriber);

        doOnEach.subscribe(subscribedSubscriber);

        // ensure the leaf observer is still getting called
        verify(subscribedSubscriber, never()).onError(any(Throwable.class));

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 55

                      Flowable<String> base = Flowable.just("a", "b", "c");
        Flowable<String> doOnEach = base.doOnEach(sideEffectSubscriber);

        doOnEach.subscribe(subscribedSubscriber);

        // ensure the leaf observer is still getting called
        verify(subscribedSubscriber, never()).onError(any(Throwable.class));
        verify(subscribedSubscriber, times(1)).onNext("a");
        verify(subscribedSubscriber, times(1)).onNext("b");

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 58

                      doOnEach.subscribe(subscribedSubscriber);

        // ensure the leaf observer is still getting called
        verify(subscribedSubscriber, never()).onError(any(Throwable.class));
        verify(subscribedSubscriber, times(1)).onNext("a");
        verify(subscribedSubscriber, times(1)).onNext("b");
        verify(subscribedSubscriber, times(1)).onNext("c");
        verify(subscribedSubscriber, times(1)).onComplete();


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 59

              
        // ensure the leaf observer is still getting called
        verify(subscribedSubscriber, never()).onError(any(Throwable.class));
        verify(subscribedSubscriber, times(1)).onNext("a");
        verify(subscribedSubscriber, times(1)).onNext("b");
        verify(subscribedSubscriber, times(1)).onNext("c");
        verify(subscribedSubscriber, times(1)).onComplete();

        // ensure our injected observer is getting called

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/mixed/ObservableConcatMapCompletableTest.java
179 issues
This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.operators.mixed;

import static org.junit.Assert.*;

import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 33

              import io.reactivex.rxjava3.subjects.*;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableConcatMapCompletableTest extends RxJavaTest {

    @Test
    public void simple() {
        Observable.range(1, 5)
        .concatMapCompletable(Functions.justFunction(Completable.complete()))

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 36

              public class ObservableConcatMapCompletableTest extends RxJavaTest {

    @Test
    public void simple() {
        Observable.range(1, 5)
        .concatMapCompletable(Functions.justFunction(Completable.complete()))
        .test()
        .assertResult();
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void simple() {
        Observable.range(1, 5)
        .concatMapCompletable(Functions.justFunction(Completable.complete()))
        .test()
        .assertResult();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void simple() {
        Observable.range(1, 5)
        .concatMapCompletable(Functions.justFunction(Completable.complete()))
        .test()
        .assertResult();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void simple() {
        Observable.range(1, 5)
        .concatMapCompletable(Functions.justFunction(Completable.complete()))
        .test()
        .assertResult();
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 56

                      .test()
        .assertResult();

        assertEquals(5, counter.get());
    }

    @Test
    public void simpleLongPrefetch() {
        Observable.range(1, 1024)

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 60

                  }

    @Test
    public void simpleLongPrefetch() {
        Observable.range(1, 1024)
        .concatMapCompletable(Functions.justFunction(Completable.complete()), 32)
        .test()
        .assertResult();
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 61

              
    @Test
    public void simpleLongPrefetch() {
        Observable.range(1, 1024)
        .concatMapCompletable(Functions.justFunction(Completable.complete()), 32)
        .test()
        .assertResult();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 61

              
    @Test
    public void simpleLongPrefetch() {
        Observable.range(1, 1024)
        .concatMapCompletable(Functions.justFunction(Completable.complete()), 32)
        .test()
        .assertResult();
    }


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableMergeTest.java
178 issues
This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.operators.completable;

import static org.junit.Assert.*;

import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 36

              import io.reactivex.rxjava3.subjects.CompletableSubject;
import io.reactivex.rxjava3.testsupport.*;

public class CompletableMergeTest extends RxJavaTest {
    @Test
    public void invalidPrefetch() {
        try {
            Completable.merge(Flowable.just(Completable.complete()), -99);
            fail("Should have thrown IllegalArgumentExceptio");

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 43

                          Completable.merge(Flowable.just(Completable.complete()), -99);
            fail("Should have thrown IllegalArgumentExceptio");
        } catch (IllegalArgumentException ex) {
            assertEquals("maxConcurrency > 0 required but it was -99", ex.getMessage());
        }
    }

    @Test
    public void cancelAfterFirst() {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 48

                  }

    @Test
    public void cancelAfterFirst() {
        final TestObserver<Void> to = new TestObserver<>();

        Completable.mergeArray(new Completable() {
            @Override
            protected void subscribeActual(CompletableObserver observer) {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 65

                  }

    @Test
    public void cancelAfterFirstDelayError() {
        final TestObserver<Void> to = new TestObserver<>();

        Completable.mergeArrayDelayError(new Completable() {
            @Override
            protected void subscribeActual(CompletableObserver observer) {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 82

                  }

    @Test
    public void onErrorAfterComplete() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            final CompletableObserver[] co = { null };

            Completable.mergeArrayDelayError(Completable.complete(), new Completable() {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 107

                  }

    @Test
    public void completeAfterMain() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestObserver<Void> to = Completable.mergeArray(Completable.complete(), pp.ignoreElements())
        .test();


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 110

                  public void completeAfterMain() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestObserver<Void> to = Completable.mergeArray(Completable.complete(), pp.ignoreElements())
        .test();

        pp.onComplete();

        to.assertResult();

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 110

                  public void completeAfterMain() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestObserver<Void> to = Completable.mergeArray(Completable.complete(), pp.ignoreElements())
        .test();

        pp.onComplete();

        to.assertResult();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 113

                      TestObserver<Void> to = Completable.mergeArray(Completable.complete(), pp.ignoreElements())
        .test();

        pp.onComplete();

        to.assertResult();
    }

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/FlowableFlatMapStreamTest.java
176 issues
This class has too many methods, consider refactoring it.
Design

Line: 34

              import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class FlowableFlatMapStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 37

              public class FlowableFlatMapStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 38

              
    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 38

              
    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 38

              
    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }


            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 45

                  }

    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.