The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWithLatestFromTest.java
242 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.flowable;

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


            

Reported by PMD.

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

Line: 37

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

public class FlowableWithLatestFromTest extends RxJavaTest {
    static final BiFunction<Integer, Integer, Integer> COMBINER = new BiFunction<Integer, Integer, Integer>() {
        @Override
        public Integer apply(Integer t1, Integer t2) {
            return (t1 << 8) + t2;
        }

            

Reported by PMD.

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

Line: 58

                      Subscriber<Integer> subscriber = TestHelper.mockSubscriber();
        InOrder inOrder = inOrder(subscriber);

        Flowable<Integer> result = source.withLatestFrom(other, COMBINER);

        result.subscribe(subscriber);

        source.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

            

Reported by PMD.

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

Line: 60

              
        Flowable<Integer> result = source.withLatestFrom(other, COMBINER);

        result.subscribe(subscriber);

        source.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        other.onNext(1);

            

Reported by PMD.

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

Line: 62

              
        result.subscribe(subscriber);

        source.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());


            

Reported by PMD.

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

Line: 63

                      result.subscribe(subscriber);

        source.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        source.onNext(2);

            

Reported by PMD.

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

Line: 63

                      result.subscribe(subscriber);

        source.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        source.onNext(2);

            

Reported by PMD.

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

Line: 65

                      source.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        source.onNext(2);
        inOrder.verify(subscriber).onNext((2 << 8) + 1);


            

Reported by PMD.

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

Line: 66

                      inOrder.verify(subscriber, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        source.onNext(2);
        inOrder.verify(subscriber).onNext((2 << 8) + 1);

        other.onNext(2);

            

Reported by PMD.

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

Line: 66

                      inOrder.verify(subscriber, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(subscriber, never()).onNext(anyInt());

        source.onNext(2);
        inOrder.verify(subscriber).onNext((2 << 8) + 1);

        other.onNext(2);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableCreateTest.java
240 issues
Avoid reassigning parameters such as 'e'
Design

Line: 149

              
            Flowable.<Integer>create(new FlowableOnSubscribe<Integer>() {
                @Override
                public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                    e = e.serialize();

                    e.setDisposable(d);

                    e.onNext(1);

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 184

              
            Flowable.<Integer>create(new FlowableOnSubscribe<Integer>() {
                @Override
                public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                    e = e.serialize();

                    e.setDisposable(d);

                    e.onNext(1);

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 409

              
            Flowable.create(new FlowableOnSubscribe<Integer>() {
                @Override
                public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                    e = e.serialize();
                    try {
                        e.onNext(null);
                        e.onNext(1);
                        e.onError(new TestException());

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 440

              
            Flowable.create(new FlowableOnSubscribe<Integer>() {
                @Override
                public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                    e = e.serialize();
                    try {
                        e.onNext(null);
                        e.onNext(1);
                        e.onError(new TestException());

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 471

              
            Flowable.create(new FlowableOnSubscribe<Integer>() {
                @Override
                public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                    e = e.serialize();
                    try {
                        e.onNext(null);
                        e.onNext(1);
                        e.onError(new TestException());

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 502

              
            Flowable.create(new FlowableOnSubscribe<Integer>() {
                @Override
                public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                    e = e.serialize();
                    try {
                        e.onNext(null);
                        e.onNext(1);
                        e.onError(new TestException());

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 533

              
            Flowable.create(new FlowableOnSubscribe<Integer>() {
                @Override
                public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                    e = e.serialize();
                    try {
                        e.onNext(null);
                        e.onNext(1);
                        e.onError(new TestException());

            

Reported by PMD.

System.out.println is used
Design

Line: 650

                  @Test
    public void nullThrowable() {
        for (BackpressureStrategy m : BackpressureStrategy.values()) {
            System.out.println(m);
            Flowable.create(new FlowableOnSubscribe<Object>() {
                @Override
                public void subscribe(FlowableEmitter<Object> e) throws Exception {
                    e.onError(null);
                }

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 844

              
                Flowable.create(new FlowableOnSubscribe<Integer>() {
                    @Override
                    public void subscribe(FlowableEmitter<Integer> e) throws Exception {
                        e = e.serialize();
                        try {
                            e.onNext(null);
                            e.onNext(1);
                            e.onError(new TestException());

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 1026

                              final Boolean[] response = { null };
                Flowable.create(new FlowableOnSubscribe<Object>() {
                    @Override
                    public void subscribe(FlowableEmitter<Object> e) throws Exception {
                        e = e.serialize();
                        e.onNext(1);
                        response[0] = e.tryOnError(new TestException());
                    }
                }, strategy)

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithSizeTest.java
238 issues
System.out.println is used
Design

Line: 268

                                      // do nothing
                    }
                }
                System.out.println("Hot done.");
            }
        }).subscribeOn(Schedulers.newThread()); // use newThread since we are using sleep to block
    }

    @Test

            

Reported by PMD.

System.out.println is used
Design

Line: 326

              
        ts.request(5);

        System.out.println(ts.values());

        ts.assertValues(Arrays.asList(1, 2), Arrays.asList(2, 3),
                Arrays.asList(3, 4), Arrays.asList(4, 5), Arrays.asList(5));
        ts.assertNoErrors();
        ts.assertComplete();

            

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.

Possible God Class (WMC=48, ATFD=44, TCC=0.000%)
Design

Line: 37

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

public class FlowableWindowWithSizeTest extends RxJavaTest {

    private static <T> List<List<T>> toLists(Flowable<Flowable<T>> observables) {

        return observables.flatMapSingle(new Function<Flowable<T>, SingleSource<List<T>>>() {
            @Override

            

Reported by PMD.

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

Line: 37

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

public class FlowableWindowWithSizeTest extends RxJavaTest {

    private static <T> List<List<T>> toLists(Flowable<Flowable<T>> observables) {

        return observables.flatMapSingle(new Function<Flowable<T>, SingleSource<List<T>>>() {
            @Override

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 50

                  }

    @Test
    public void nonOverlappingWindows() {
        Flowable<String> subject = Flowable.just("one", "two", "three", "four", "five");
        Flowable<Flowable<String>> windowed = subject.window(3);

        List<List<String>> windows = toLists(windowed);


            

Reported by PMD.

The String literal 'two' appears 10 times in this file; the first occurrence is on line 51
Error

Line: 51

              
    @Test
    public void nonOverlappingWindows() {
        Flowable<String> subject = Flowable.just("one", "two", "three", "four", "five");
        Flowable<Flowable<String>> windowed = subject.window(3);

        List<List<String>> windows = toLists(windowed);

        assertEquals(2, windows.size());

            

Reported by PMD.

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

Line: 51

              
    @Test
    public void nonOverlappingWindows() {
        Flowable<String> subject = Flowable.just("one", "two", "three", "four", "five");
        Flowable<Flowable<String>> windowed = subject.window(3);

        List<List<String>> windows = toLists(windowed);

        assertEquals(2, windows.size());

            

Reported by PMD.

The String literal 'five' appears 10 times in this file; the first occurrence is on line 51
Error

Line: 51

              
    @Test
    public void nonOverlappingWindows() {
        Flowable<String> subject = Flowable.just("one", "two", "three", "four", "five");
        Flowable<Flowable<String>> windowed = subject.window(3);

        List<List<String>> windows = toLists(windowed);

        assertEquals(2, windows.size());

            

Reported by PMD.

The String literal 'three' appears 9 times in this file; the first occurrence is on line 51
Error

Line: 51

              
    @Test
    public void nonOverlappingWindows() {
        Flowable<String> subject = Flowable.just("one", "two", "three", "four", "five");
        Flowable<Flowable<String>> windowed = subject.window(3);

        List<List<String>> windows = toLists(windowed);

        assertEquals(2, windows.size());

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/subjects/AsyncSubjectTest.java
237 issues
Avoid throwing raw exception types.
Design

Line: 232

                              t4.join();
                t5.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

            assertEquals("value", value1.get());
            assertEquals("value", t2.value.get());
            assertEquals("value", t3.value.get());

            

Reported by PMD.

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

Line: 34

              import io.reactivex.rxjava3.observers.TestObserver;
import io.reactivex.rxjava3.testsupport.*;

public class AsyncSubjectTest extends SubjectTest<Integer> {

    private final Throwable testException = new Throwable();

    @Override
    protected Subject<Integer> create() {

            

Reported by PMD.

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

Line: 36

              
public class AsyncSubjectTest extends SubjectTest<Integer> {

    private final Throwable testException = new Throwable();

    @Override
    protected Subject<Integer> create() {
        return AsyncSubject.create();
    }

            

Reported by PMD.

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

Line: 48

                      AsyncSubject<String> subject = AsyncSubject.create();

        Observer<String> observer = TestHelper.mockObserver();
        subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");


            

Reported by PMD.

The String literal 'one' appears 6 times in this file; the first occurrence is on line 50
Error

Line: 50

                      Observer<String> observer = TestHelper.mockObserver();
        subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");

        verify(observer, Mockito.never()).onNext(anyString());
        verify(observer, Mockito.never()).onError(testException);

            

Reported by PMD.

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

Line: 50

                      Observer<String> observer = TestHelper.mockObserver();
        subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");

        verify(observer, Mockito.never()).onNext(anyString());
        verify(observer, Mockito.never()).onError(testException);

            

Reported by PMD.

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

Line: 51

                      subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");

        verify(observer, Mockito.never()).onNext(anyString());
        verify(observer, Mockito.never()).onError(testException);
        verify(observer, Mockito.never()).onComplete();

            

Reported by PMD.

The String literal 'two' appears 6 times in this file; the first occurrence is on line 51
Error

Line: 51

                      subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");

        verify(observer, Mockito.never()).onNext(anyString());
        verify(observer, Mockito.never()).onError(testException);
        verify(observer, Mockito.never()).onComplete();

            

Reported by PMD.

The String literal 'three' appears 8 times in this file; the first occurrence is on line 52
Error

Line: 52

              
        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");

        verify(observer, Mockito.never()).onNext(anyString());
        verify(observer, Mockito.never()).onError(testException);
        verify(observer, Mockito.never()).onComplete();
    }

            

Reported by PMD.

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

Line: 52

              
        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");

        verify(observer, Mockito.never()).onNext(anyString());
        verify(observer, Mockito.never()).onError(testException);
        verify(observer, Mockito.never()).onComplete();
    }

            

Reported by PMD.

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

Line: 32

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

public class FlowableMapOptionalTest extends RxJavaTest {

    static final Function<? super Integer, Optional<? extends Integer>> MODULO = v -> v % 2 == 0 ? Optional.of(v) : Optional.<Integer>empty();

    @Test
    public void allPresent() {

            

Reported by PMD.

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

Line: 37

                  static final Function<? super Integer, Optional<? extends Integer>> MODULO = v -> v % 2 == 0 ? Optional.of(v) : Optional.<Integer>empty();

    @Test
    public void allPresent() {
        Flowable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }

            

Reported by PMD.

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

Line: 38

              
    @Test
    public void allPresent() {
        Flowable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

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

Line: 38

              
    @Test
    public void allPresent() {
        Flowable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

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

Line: 38

              
    @Test
    public void allPresent() {
        Flowable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

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

Line: 45

                  }

    @Test
    public void allEmpty() {
        Flowable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 46

              
    @Test
    public void allEmpty() {
        Flowable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 46

              
    @Test
    public void allEmpty() {
        Flowable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 46

              
    @Test
    public void allEmpty() {
        Flowable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 53

                  }

    @Test
    public void mixed() {
        Flowable.range(1, 10)
        .mapOptional(MODULO)
        .test()
        .assertResult(2, 4, 6, 8, 10);
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservablePublishTest.java
233 issues
System.out.println is used
Design

Line: 101

                      .doOnComplete(new Action() {
            @Override
            public void run() {
                System.out.println("^^^^^^^^^^^^^ completed FAST");
            }
        });

        Observable<Integer> slow = is.observeOn(Schedulers.computation()).map(new Function<Integer, Integer>() {
            int c;

            

Reported by PMD.

System.out.println is used
Design

Line: 124

              
            @Override
            public void run() {
                System.out.println("^^^^^^^^^^^^^ completed SLOW");
            }

        });

        TestObserver<Integer> to = new TestObserver<>();

            

Reported by PMD.

System.out.println is used
Design

Line: 169

                      to.assertNoErrors();
        to.assertValues(0, 1, 2, 3);
        assertEquals(5, emitted.get());
        System.out.println(to.values());
    }

    // use case from https://github.com/ReactiveX/RxJava/issues/1732
    @Test
    public void takeUntilWithPublishedStream() {

            

Reported by PMD.

System.out.println is used
Design

Line: 187

              
        })).subscribe(to);
        xsp.connect();
        System.out.println(to.values());
    }

    @Test
    public void backpressureTwoConsumers() {
        final AtomicInteger sourceEmission = new AtomicInteger();

            

Reported by PMD.

System.out.println is used
Design

Line: 295

                      to2.assertNoErrors();
        to2.assertTerminated();

        System.out.println(connection);
        System.out.println(connection2);
    }

    @Test
    public void noSubscriberRetentionOnCompleted() {

            

Reported by PMD.

System.out.println is used
Design

Line: 296

                      to2.assertTerminated();

        System.out.println(connection);
        System.out.println(connection2);
    }

    @Test
    public void noSubscriberRetentionOnCompleted() {
        ObservablePublish<Integer> source = (ObservablePublish<Integer>)Observable.just(1).publish();

            

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.observable;

import static org.junit.Assert.*;

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

            

Reported by PMD.

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

Line: 39

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

public class ObservablePublishTest extends RxJavaTest {

    @Test
    public void publish() throws InterruptedException {
        final AtomicInteger counter = new AtomicInteger();
        ConnectableObservable<String> o = Observable.unsafeCreate(new ObservableSource<String>() {

            

Reported by PMD.

Possible God Class (WMC=54, ATFD=37, TCC=0.000%)
Design

Line: 39

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

public class ObservablePublishTest extends RxJavaTest {

    @Test
    public void publish() throws InterruptedException {
        final AtomicInteger counter = new AtomicInteger();
        ConnectableObservable<String> o = Observable.unsafeCreate(new ObservableSource<String>() {

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 42

              public class ObservablePublishTest extends RxJavaTest {

    @Test
    public void publish() throws InterruptedException {
        final AtomicInteger counter = new AtomicInteger();
        ConnectableObservable<String> o = Observable.unsafeCreate(new ObservableSource<String>() {

            @Override
            public void subscribe(final Observer<? super String> observer) {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatMapEagerTest.java
233 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.flowable;

import static org.junit.Assert.*;

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

            

Reported by PMD.

Avoid really long classes.
Design

Line: 36

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

public class FlowableConcatMapEagerTest extends RxJavaTest {

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

            

Reported by PMD.

Possible God Class (WMC=87, ATFD=81, TCC=4.060%)
Design

Line: 36

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

public class FlowableConcatMapEagerTest extends RxJavaTest {

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

            

Reported by PMD.

The class 'FlowableConcatMapEagerTest' has a total cyclomatic complexity of 87 (highest 4).
Design

Line: 36

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

public class FlowableConcatMapEagerTest extends RxJavaTest {

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

            

Reported by PMD.

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

Line: 36

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

public class FlowableConcatMapEagerTest extends RxJavaTest {

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

            

Reported by PMD.

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

Line: 168

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

        main.onNext(1);

        inner.onNext(2);

        ts.assertValue(2);


            

Reported by PMD.

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

Line: 170

              
        main.onNext(1);

        inner.onNext(2);

        ts.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 174
Error

Line: 174

              
        ts.assertValue(2);

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

        ts.assertNoErrors();

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

            

Reported by PMD.

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

Line: 178

              
        ts.assertNoErrors();

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

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


            

Reported by PMD.

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

Line: 179

                      ts.assertNoErrors();

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

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

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/processors/AsyncProcessorTest.java
230 issues
Avoid throwing raw exception types.
Design

Line: 232

                              t4.join();
                t5.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

            assertEquals("value", value1.get());
            assertEquals("value", t2.value.get());
            assertEquals("value", t3.value.get());

            

Reported by PMD.

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

Line: 34

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

public class AsyncProcessorTest extends FlowableProcessorTest<Object> {

    private final Throwable testException = new Throwable();

    @Override
    protected FlowableProcessor<Object> create() {

            

Reported by PMD.

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

Line: 36

              
public class AsyncProcessorTest extends FlowableProcessorTest<Object> {

    private final Throwable testException = new Throwable();

    @Override
    protected FlowableProcessor<Object> create() {
        return AsyncProcessor.create();
    }

            

Reported by PMD.

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

Line: 48

                      AsyncProcessor<String> processor = AsyncProcessor.create();

        Subscriber<String> subscriber = TestHelper.mockSubscriber();
        processor.subscribe(subscriber);

        processor.onNext("one");
        processor.onNext("two");
        processor.onNext("three");


            

Reported by PMD.

The String literal 'one' appears 6 times in this file; the first occurrence is on line 50
Error

Line: 50

                      Subscriber<String> subscriber = TestHelper.mockSubscriber();
        processor.subscribe(subscriber);

        processor.onNext("one");
        processor.onNext("two");
        processor.onNext("three");

        verify(subscriber, Mockito.never()).onNext(anyString());
        verify(subscriber, Mockito.never()).onError(testException);

            

Reported by PMD.

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

Line: 50

                      Subscriber<String> subscriber = TestHelper.mockSubscriber();
        processor.subscribe(subscriber);

        processor.onNext("one");
        processor.onNext("two");
        processor.onNext("three");

        verify(subscriber, Mockito.never()).onNext(anyString());
        verify(subscriber, Mockito.never()).onError(testException);

            

Reported by PMD.

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

Line: 51

                      processor.subscribe(subscriber);

        processor.onNext("one");
        processor.onNext("two");
        processor.onNext("three");

        verify(subscriber, Mockito.never()).onNext(anyString());
        verify(subscriber, Mockito.never()).onError(testException);
        verify(subscriber, Mockito.never()).onComplete();

            

Reported by PMD.

The String literal 'two' appears 6 times in this file; the first occurrence is on line 51
Error

Line: 51

                      processor.subscribe(subscriber);

        processor.onNext("one");
        processor.onNext("two");
        processor.onNext("three");

        verify(subscriber, Mockito.never()).onNext(anyString());
        verify(subscriber, Mockito.never()).onError(testException);
        verify(subscriber, Mockito.never()).onComplete();

            

Reported by PMD.

The String literal 'three' appears 8 times in this file; the first occurrence is on line 52
Error

Line: 52

              
        processor.onNext("one");
        processor.onNext("two");
        processor.onNext("three");

        verify(subscriber, Mockito.never()).onNext(anyString());
        verify(subscriber, Mockito.never()).onError(testException);
        verify(subscriber, Mockito.never()).onComplete();
    }

            

Reported by PMD.

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

Line: 52

              
        processor.onNext("one");
        processor.onNext("two");
        processor.onNext("three");

        verify(subscriber, Mockito.never()).onNext(anyString());
        verify(subscriber, Mockito.never()).onError(testException);
        verify(subscriber, Mockito.never()).onComplete();
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/subjects/PublishSubjectTest.java
228 issues
System.out.printf is used
Design

Line: 310

                          final Observer<Object> o = TestHelper.mockObserver();
            InOrder inOrder = inOrder(o);
            String v = "" + i;
            System.out.printf("Turn: %d%n", i);
            src.firstElement()
                .toObservable()
                .flatMap(new Function<String, Observable<String>>() {

                    @Override

            

Reported by PMD.

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

Line: 34

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

public class PublishSubjectTest extends SubjectTest<Integer> {

    @Override
    protected Subject<Integer> create() {
        return PublishSubject.create();
    }

            

Reported by PMD.

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

Line: 47

                      PublishSubject<String> subject = PublishSubject.create();

        Observer<String> observer = TestHelper.mockObserver();
        subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

            

Reported by PMD.

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

Line: 49

                      Observer<String> observer = TestHelper.mockObserver();
        subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

        Observer<String> anotherSubscriber = TestHelper.mockObserver();

            

Reported by PMD.

The String literal 'one' appears 8 times in this file; the first occurrence is on line 49
Error

Line: 49

                      Observer<String> observer = TestHelper.mockObserver();
        subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

        Observer<String> anotherSubscriber = TestHelper.mockObserver();

            

Reported by PMD.

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

Line: 50

                      subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

        Observer<String> anotherSubscriber = TestHelper.mockObserver();
        subject.subscribe(anotherSubscriber);

            

Reported by PMD.

The String literal 'two' appears 8 times in this file; the first occurrence is on line 50
Error

Line: 50

                      subject.subscribe(observer);

        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

        Observer<String> anotherSubscriber = TestHelper.mockObserver();
        subject.subscribe(anotherSubscriber);

            

Reported by PMD.

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

Line: 51

              
        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

        Observer<String> anotherSubscriber = TestHelper.mockObserver();
        subject.subscribe(anotherSubscriber);


            

Reported by PMD.

The String literal 'three' appears 8 times in this file; the first occurrence is on line 51
Error

Line: 51

              
        subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

        Observer<String> anotherSubscriber = TestHelper.mockObserver();
        subject.subscribe(anotherSubscriber);


            

Reported by PMD.

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

Line: 52

                      subject.onNext("one");
        subject.onNext("two");
        subject.onNext("three");
        subject.onComplete();

        Observer<String> anotherSubscriber = TestHelper.mockObserver();
        subject.subscribe(anotherSubscriber);

        subject.onNext("four");

            

Reported by PMD.

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

Line: 31

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

public class MaybeTakeUntilTest extends RxJavaTest {

    @Test
    public void normalPublisher() {
        Maybe.just(1).takeUntil(Flowable.never())
        .test()

            

Reported by PMD.

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

Line: 34

              public class MaybeTakeUntilTest extends RxJavaTest {

    @Test
    public void normalPublisher() {
        Maybe.just(1).takeUntil(Flowable.never())
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 35

              
    @Test
    public void normalPublisher() {
        Maybe.just(1).takeUntil(Flowable.never())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 35

              
    @Test
    public void normalPublisher() {
        Maybe.just(1).takeUntil(Flowable.never())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 35

              
    @Test
    public void normalPublisher() {
        Maybe.just(1).takeUntil(Flowable.never())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 41

                  }

    @Test
    public void normalMaybe() {
        Maybe.just(1).takeUntil(Maybe.never())
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 42

              
    @Test
    public void normalMaybe() {
        Maybe.just(1).takeUntil(Maybe.never())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 42

              
    @Test
    public void normalMaybe() {
        Maybe.just(1).takeUntil(Maybe.never())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 42

              
    @Test
    public void normalMaybe() {
        Maybe.just(1).takeUntil(Maybe.never())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 48

                  }

    @Test
    public void untilFirstPublisher() {
        Maybe.just(1).takeUntil(Flowable.just("one"))
        .test()
        .assertResult();
    }


            

Reported by PMD.