The following issues were found

src/test/java/io/reactivex/rxjava3/completable/CompletableTimerTest.java
5 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 29

              
public class CompletableTimerTest extends RxJavaTest {
    @Test
    public void timer() {
        final TestScheduler testScheduler = new TestScheduler();

        final AtomicLong atomicLong = new AtomicLong();
        Completable.timer(2, TimeUnit.SECONDS, testScheduler).subscribe(new Action() {
            @Override

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 40

                          }
        });

        assertEquals(0, atomicLong.get());

        testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        assertEquals(0, atomicLong.get());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 44

              
        testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        assertEquals(0, atomicLong.get());

        testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        assertEquals(1, atomicLong.get());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 48

              
        testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        assertEquals(1, atomicLong.get());
    }
}

            

Reported by PMD.

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

Line: 23

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Action;
import io.reactivex.rxjava3.schedulers.TestScheduler;

public class CompletableTimerTest extends RxJavaTest {
    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeConcatPublisherTest.java
5 issues
JUnit tests should include assert() or fail()
Design

Line: 25

              public class MaybeConcatPublisherTest extends RxJavaTest {

    @Test
    public void scalar() {
        Maybe.concat(Flowable.just(Maybe.just(1)))
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 26

              
    @Test
    public void scalar() {
        Maybe.concat(Flowable.just(Maybe.just(1)))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 26

              
    @Test
    public void scalar() {
        Maybe.concat(Flowable.just(Maybe.just(1)))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 32

                  }

    @Test
    public void callable() {
        Maybe.concat(Flowable.fromCallable(new Callable<Maybe<Integer>>() {
            @Override
            public Maybe<Integer> call() throws Exception {
                return Maybe.just(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.*;

public class MaybeConcatPublisherTest extends RxJavaTest {

    @Test
    public void scalar() {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableFlattenIterableTest.java
5 issues
JUnit tests should include assert() or fail()
Design

Line: 33

              public class ObservableFlattenIterableTest extends RxJavaTest {

    @Test
    public void dispose() {
        TestHelper.checkDisposed(PublishSubject.create().flatMapIterable(new Function<Object, Iterable<Integer>>() {
            @Override
            public Iterable<Integer> apply(Object v) throws Exception {
                return Arrays.asList(10, 20);
            }

            

Reported by PMD.

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

Line: 43

                  }

    @Test
    public void badSource() {
        TestHelper.checkBadSourceObservable(new Function<Observable<Integer>, Object>() {
            @Override
            public Object apply(Observable<Integer> o) throws Exception {
                return o.flatMapIterable(new Function<Object, Iterable<Integer>>() {
                    @Override

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 97

                      .test()
        .assertFailure(TestException.class);

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

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeObservable(o -> o.flatMapIterable(v -> Collections.singletonList(v)));

            

Reported by PMD.

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

Line: 101

                  }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeObservable(o -> o.flatMapIterable(v -> Collections.singletonList(v)));
    }
}

            

Reported by PMD.

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

Line: 26

              import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.RxJavaTest;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableFlattenIterableTest extends RxJavaTest {


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableFromSingleTest.java
5 issues
JUnit tests should include assert() or fail()
Design

Line: 22

              
public class CompletableFromSingleTest extends RxJavaTest {
    @Test
    public void fromSingle() {
        Completable.fromSingle(Single.just(1))
            .test()
            .assertResult();
    }


            

Reported by PMD.

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

Line: 23

              public class CompletableFromSingleTest extends RxJavaTest {
    @Test
    public void fromSingle() {
        Completable.fromSingle(Single.just(1))
            .test()
            .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 23

              public class CompletableFromSingleTest extends RxJavaTest {
    @Test
    public void fromSingle() {
        Completable.fromSingle(Single.just(1))
            .test()
            .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 29

                  }

    @Test
    public void fromSingleError() {
        Completable.fromSingle(Single.error(new UnsupportedOperationException()))
            .test()
            .assertFailure(UnsupportedOperationException.class);
    }
}

            

Reported by PMD.

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

Line: 18

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;

public class CompletableFromSingleTest extends RxJavaTest {
    @Test
    public void fromSingle() {
        Completable.fromSingle(Single.just(1))

            

Reported by PMD.

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

Line: 25

              public class SingleConcatPublisherTest extends RxJavaTest {

    @Test
    public void scalar() {
        Single.concat(Flowable.just(Single.just(1)))
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 26

              
    @Test
    public void scalar() {
        Single.concat(Flowable.just(Single.just(1)))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 26

              
    @Test
    public void scalar() {
        Single.concat(Flowable.just(Single.just(1)))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 32

                  }

    @Test
    public void callable() {
        Single.concat(Flowable.fromCallable(new Callable<Single<Integer>>() {
            @Override
            public Single<Integer> call() throws Exception {
                return Single.just(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.*;

public class SingleConcatPublisherTest extends RxJavaTest {

    @Test
    public void scalar() {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeMergeWithTest.java
5 issues
JUnit tests should include assert() or fail()
Design

Line: 23

              public class MaybeMergeWithTest extends RxJavaTest {

    @Test
    public void normal() {
        Maybe.just(1).mergeWith(Maybe.just(2))
        .test()
        .assertResult(1, 2);
    }
}

            

Reported by PMD.

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

Line: 24

              
    @Test
    public void normal() {
        Maybe.just(1).mergeWith(Maybe.just(2))
        .test()
        .assertResult(1, 2);
    }
}

            

Reported by PMD.

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

Line: 24

              
    @Test
    public void normal() {
        Maybe.just(1).mergeWith(Maybe.just(2))
        .test()
        .assertResult(1, 2);
    }
}

            

Reported by PMD.

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

Line: 24

              
    @Test
    public void normal() {
        Maybe.just(1).mergeWith(Maybe.just(2))
        .test()
        .assertResult(1, 2);
    }
}

            

Reported by PMD.

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

Line: 18

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;

public class MaybeMergeWithTest extends RxJavaTest {

    @Test
    public void normal() {

            

Reported by PMD.

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

Line: 30

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

    @Override
    public Publisher<Integer> createFailedPublisher() {

            

Reported by PMD.

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

Line: 30

                  @Override
    public Publisher<Integer> createPublisher(final long elements) {
        return
                Flowable.just(1).hide().flatMapStream(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 Flowable.just(1).hide().flatMapStream(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 Flowable.just(1).hide().flatMapStream(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 Flowable.just(1).hide().flatMapStream(v -> stream);
    }
}

            

Reported by PMD.

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

Line: 27

              public class SingleToFlowableTest extends RxJavaTest {

    @Test
    public void dispose() {
        TestHelper.checkDisposed(PublishSubject.create().singleOrError().toFlowable());
    }

    @Test
    public void doubleOnSubscribe() {

            

Reported by PMD.

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

Line: 28

              
    @Test
    public void dispose() {
        TestHelper.checkDisposed(PublishSubject.create().singleOrError().toFlowable());
    }

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

            

Reported by PMD.

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

Line: 28

              
    @Test
    public void dispose() {
        TestHelper.checkDisposed(PublishSubject.create().singleOrError().toFlowable());
    }

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

            

Reported by PMD.

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

Line: 32

                  }

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

            

Reported by PMD.

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

Line: 19

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

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class SingleToFlowableTest extends RxJavaTest {

            

Reported by PMD.

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

Line: 24

              public class SingleDeferTest extends RxJavaTest {

    @Test
    public void normal() {

        Single<Integer> s = Single.defer(new Supplier<Single<Integer>>() {
            int counter;
            @Override
            public Single<Integer> get() throws Exception {

            

Reported by PMD.

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

Line: 35

                      });

        for (int i = 1; i < 33; i++) {
            s.test().assertResult(i);
        }
    }
}

            

Reported by PMD.

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

Line: 18

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Supplier;

public class SingleDeferTest extends RxJavaTest {

    @Test

            

Reported by PMD.

Found 'DU'-anomaly for variable 's' (lines '26'-'37').
Error

Line: 26

                  @Test
    public void normal() {

        Single<Integer> s = Single.defer(new Supplier<Single<Integer>>() {
            int counter;
            @Override
            public Single<Integer> get() throws Exception {
                return Single.just(++counter);
            }

            

Reported by PMD.

Found 'DU'-anomaly for variable 's' (lines '26'-'37').
Error

Line: 26

                  @Test
    public void normal() {

        Single<Integer> s = Single.defer(new Supplier<Single<Integer>>() {
            int counter;
            @Override
            public Single<Integer> get() throws Exception {
                return Single.just(++counter);
            }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableDoOnRequestTest.java
5 issues
JUnit assertions should include a message
Design

Line: 49

                              })
                //
                .subscribe().dispose();
        assertTrue(unsubscribed.get());
    }

    @Test
    public void doRequest() {
        final List<Long> requests = new ArrayList<>();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 86

                                      request(t);
                    }
                });
        assertEquals(Arrays.asList(3L, 1L, 2L, 3L, 4L, 5L), requests);
    }
}

            

Reported by PMD.

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

Line: 16

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

import static org.junit.Assert.*;

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

import org.junit.Test;

            

Reported by PMD.

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

Line: 23

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.subscribers.DefaultSubscriber;

public class FlowableDoOnRequestTest extends RxJavaTest {


            

Reported by PMD.

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

Line: 24

              import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.subscribers.DefaultSubscriber;

public class FlowableDoOnRequestTest extends RxJavaTest {

    @Test

            

Reported by PMD.