The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleConcatDelayErrorTest.java
4 issues
JUnit tests should include assert() or fail()
Design

Line: 26

              public class SingleConcatDelayErrorTest {

    @Test
    public void normalIterable() {
        Single.concatDelayError(Arrays.asList(
                Single.just(1),
                Single.<Integer>error(new TestException()),
                Single.just(2)
        ))

            

Reported by PMD.

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

Line: 37

                  }

    @Test
    public void normalPublisher() {
        Single.concatDelayError(Flowable.fromArray(
                Single.just(1),
                Single.<Integer>error(new TestException()),
                Single.just(2)
        ))

            

Reported by PMD.

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

Line: 48

                  }

    @Test
    public void normalPublisherPrefetch() {
        Single.concatDelayError(Flowable.fromArray(
                Single.just(1),
                Single.<Integer>error(new TestException()),
                Single.just(2)
        ), 1)

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 20

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;

public class SingleConcatDelayErrorTest {

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/MaybeFlattenStreamAsFlowableTckTest.java
4 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 30

                  @Override
    public Publisher<Integer> createPublisher(final long elements) {
        return
                Maybe.just(1).flattenStreamAsFlowable(v -> IntStream.range(0, (int)elements).boxed())
            ;
    }

    @Override
    public Publisher<Integer> createFailedPublisher() {

            

Reported by PMD.

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

Line: 37

                  @Override
    public Publisher<Integer> createFailedPublisher() {
        Stream<Integer> stream = Stream.of(1);
        stream.forEach(v -> { });
        return Maybe.just(1).flattenStreamAsFlowable(v -> stream);
    }
}

            

Reported by PMD.

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

Line: 38

                  public Publisher<Integer> createFailedPublisher() {
        Stream<Integer> stream = Stream.of(1);
        stream.forEach(v -> { });
        return Maybe.just(1).flattenStreamAsFlowable(v -> stream);
    }
}

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 21

              import org.reactivestreams.Publisher;
import org.testng.annotations.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.tck.BaseTck;

@Test
public class MaybeFlattenStreamAsFlowableTckTest extends BaseTck<Integer> {


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAutoConnectTest.java
4 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 29

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

        pp.publish().autoConnect(0);

        assertTrue(pp.hasSubscribers());
    }
}

            

Reported by PMD.

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

Line: 29

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

        pp.publish().autoConnect(0);

        assertTrue(pp.hasSubscribers());
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 31

              
        pp.publish().autoConnect(0);

        assertTrue(pp.hasSubscribers());
    }
}

            

Reported by PMD.

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

Line: 31

              
        pp.publish().autoConnect(0);

        assertTrue(pp.hasSubscribers());
    }
}

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableAutoConnectTest.java
4 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 29

                  public void autoConnectImmediately() {
        PublishSubject<Integer> ps = PublishSubject.create();

        ps.publish().autoConnect(0);

        assertTrue(ps.hasObservers());
    }
}

            

Reported by PMD.

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

Line: 29

                  public void autoConnectImmediately() {
        PublishSubject<Integer> ps = PublishSubject.create();

        ps.publish().autoConnect(0);

        assertTrue(ps.hasObservers());
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 31

              
        ps.publish().autoConnect(0);

        assertTrue(ps.hasObservers());
    }
}

            

Reported by PMD.

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

Line: 31

              
        ps.publish().autoConnect(0);

        assertTrue(ps.hasObservers());
    }
}

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/SingleFlattenStreamAsFlowableTckTest.java
4 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 30

                  @Override
    public Publisher<Integer> createPublisher(final long elements) {
        return
                Single.just(1).flattenStreamAsFlowable(v -> IntStream.range(0, (int)elements).boxed())
            ;
    }

    @Override
    public Publisher<Integer> createFailedPublisher() {

            

Reported by PMD.

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

Line: 37

                  @Override
    public Publisher<Integer> createFailedPublisher() {
        Stream<Integer> stream = Stream.of(1);
        stream.forEach(v -> { });
        return Single.just(1).flattenStreamAsFlowable(v -> stream);
    }
}

            

Reported by PMD.

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

Line: 38

                  public Publisher<Integer> createFailedPublisher() {
        Stream<Integer> stream = Stream.of(1);
        stream.forEach(v -> { });
        return Single.just(1).flattenStreamAsFlowable(v -> stream);
    }
}

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 21

              import org.reactivestreams.Publisher;
import org.testng.annotations.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.tck.BaseTck;

@Test
public class SingleFlattenStreamAsFlowableTckTest extends BaseTck<Integer> {


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/observers/BlockingObserverTest.java
4 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 27

              public class BlockingObserverTest extends RxJavaTest {

    @Test
    public void dispose() {
        Queue<Object> q = new ArrayDeque<>();

        BlockingObserver<Object> bo = new BlockingObserver<>(q);

        bo.dispose();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 34

              
        bo.dispose();

        assertEquals(BlockingObserver.TERMINATED, q.poll());

        bo.dispose();

        assertNull(q.poll());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 38

              
        bo.dispose();

        assertNull(q.poll());
    }
}

            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

Line: 16

              
package io.reactivex.rxjava3.internal.observers;

import static org.junit.Assert.*;

import java.util.*;

import org.junit.Test;


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/core/PeriodicDirectTaskTest.java
4 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 35

                  public void runnableThrows() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            Scheduler.Worker worker = Schedulers.single().createWorker();

            PeriodicDirectTask task = new PeriodicDirectTask(() -> {
                throw new TestException();
            }, worker);


            

Reported by PMD.

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

Line: 50

              
            TestHelper.assertUndeliverable(errors, 0, TestException.class);

            assertTrue(worker.isDisposed());

            task.run();
        } finally {
            RxJavaPlugins.reset();
        }

            

Reported by PMD.

Found 'DU'-anomaly for variable 'errors' (lines '33'-'56').
Error

Line: 33

              
    @Test
    public void runnableThrows() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            Scheduler.Worker worker = Schedulers.single().createWorker();

            PeriodicDirectTask task = new PeriodicDirectTask(() -> {
                throw new TestException();

            

Reported by PMD.

Found 'DU'-anomaly for variable 'task' (lines '37'-'56').
Error

Line: 37

                      try {
            Scheduler.Worker worker = Schedulers.single().createWorker();

            PeriodicDirectTask task = new PeriodicDirectTask(() -> {
                throw new TestException();
            }, worker);

            try {
                task.run();

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/observers/DeferredScalarDisposableTest.java
4 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 26

              public class DeferredScalarDisposableTest extends RxJavaTest {

    @Test
    public void tryDispose() {
        TestObserver<Integer> to = new TestObserver<>();

        DeferredScalarDisposable<Integer> d = new DeferredScalarDisposable<>(to);
        to.onSubscribe(d);


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 32

                      DeferredScalarDisposable<Integer> d = new DeferredScalarDisposable<>(to);
        to.onSubscribe(d);

        assertTrue(d.tryDispose());
        assertFalse(d.tryDispose());
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 33

                      to.onSubscribe(d);

        assertTrue(d.tryDispose());
        assertFalse(d.tryDispose());
    }
}

            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

Line: 16

              
package io.reactivex.rxjava3.internal.observers;

import static org.junit.Assert.*;

import org.junit.Test;

import io.reactivex.rxjava3.core.RxJavaTest;
import io.reactivex.rxjava3.observers.TestObserver;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeToFlowableTest.java
4 issues
Potential violation of Law of Demeter (object not created locally)
Design

Line: 32

                  public void source() {
        Maybe<Integer> m = Maybe.just(1);

        assertSame(m, (((HasUpstreamMaybeSource<?>)m.toFlowable()).source()));
    }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeMaybeToFlowable(new Function<Maybe<Object>, Publisher<Object>>() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 32

                  public void source() {
        Maybe<Integer> m = Maybe.just(1);

        assertSame(m, (((HasUpstreamMaybeSource<?>)m.toFlowable()).source()));
    }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeMaybeToFlowable(new Function<Maybe<Object>, Publisher<Object>>() {

            

Reported by PMD.

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

Line: 36

                  }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeMaybeToFlowable(new Function<Maybe<Object>, Publisher<Object>>() {
            @Override
            public Publisher<Object> apply(Maybe<Object> m) throws Exception {
                return m.toFlowable();
            }

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 21

              import org.junit.Test;
import org.reactivestreams.Publisher;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.internal.fuseable.HasUpstreamMaybeSource;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class MaybeToFlowableTest extends RxJavaTest {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeToObservableTest.java
4 issues
JUnit assertions should include a message
Design

Line: 31

                  public void source() {
        Maybe<Integer> m = Maybe.just(1);

        assertSame(m, (((HasUpstreamMaybeSource<?>)m.toObservable()).source()));
    }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeMaybeToObservable(new Function<Maybe<Object>, ObservableSource<Object>>() {

            

Reported by PMD.

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

Line: 31

                  public void source() {
        Maybe<Integer> m = Maybe.just(1);

        assertSame(m, (((HasUpstreamMaybeSource<?>)m.toObservable()).source()));
    }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeMaybeToObservable(new Function<Maybe<Object>, ObservableSource<Object>>() {

            

Reported by PMD.

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

Line: 35

                  }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeMaybeToObservable(new Function<Maybe<Object>, ObservableSource<Object>>() {
            @Override
            public ObservableSource<Object> apply(Maybe<Object> m) throws Exception {
                return m.toObservable();
            }

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 20

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.internal.fuseable.HasUpstreamMaybeSource;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class MaybeToObservableTest extends RxJavaTest {

            

Reported by PMD.