The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowablePublishFunctionTest.java
138 issues
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 FlowablePublishFunctionTest extends RxJavaTest {
    @Test
    public void concatTakeFirstLastCompletes() {
        TestSubscriber<Integer> ts = new TestSubscriber<>();

        Flowable.range(1, 3)

            

Reported by PMD.

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

Line: 39

                  public void concatTakeFirstLastCompletes() {
        TestSubscriber<Integer> ts = new TestSubscriber<>();

        Flowable.range(1, 3)
                .publish(f -> Flowable.concat(f.take(5), f.takeLast(5)))
                .subscribe(ts);

        ts.assertValues(1, 2, 3);
        ts.assertNoErrors();

            

Reported by PMD.

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

Line: 39

                  public void concatTakeFirstLastCompletes() {
        TestSubscriber<Integer> ts = new TestSubscriber<>();

        Flowable.range(1, 3)
                .publish(f -> Flowable.concat(f.take(5), f.takeLast(5)))
                .subscribe(ts);

        ts.assertValues(1, 2, 3);
        ts.assertNoErrors();

            

Reported by PMD.

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

Line: 52

                  public void concatTakeFirstLastBackpressureCompletes() {
        TestSubscriber<Integer> ts = TestSubscriber.create(0L);

        Flowable.range(1, 6)
                .publish(f -> Flowable.concat(f.take(5), f.takeLast(5)))
                .subscribe(ts);

        ts.assertNoValues();
        ts.assertNoErrors();

            

Reported by PMD.

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

Line: 52

                  public void concatTakeFirstLastBackpressureCompletes() {
        TestSubscriber<Integer> ts = TestSubscriber.create(0L);

        Flowable.range(1, 6)
                .publish(f -> Flowable.concat(f.take(5), f.takeLast(5)))
                .subscribe(ts);

        ts.assertNoValues();
        ts.assertNoErrors();

            

Reported by PMD.

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

Line: 56

                              .publish(f -> Flowable.concat(f.take(5), f.takeLast(5)))
                .subscribe(ts);

        ts.assertNoValues();
        ts.assertNoErrors();
        ts.assertNotComplete();

        ts.request(1); // make sure take() doesn't go unbounded
        ts.request(4);

            

Reported by PMD.

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

Line: 57

                              .subscribe(ts);

        ts.assertNoValues();
        ts.assertNoErrors();
        ts.assertNotComplete();

        ts.request(1); // make sure take() doesn't go unbounded
        ts.request(4);


            

Reported by PMD.

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

Line: 58

              
        ts.assertNoValues();
        ts.assertNoErrors();
        ts.assertNotComplete();

        ts.request(1); // make sure take() doesn't go unbounded
        ts.request(4);

        ts.assertValues(1, 2, 3, 4, 5);

            

Reported by PMD.

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

Line: 60

                      ts.assertNoErrors();
        ts.assertNotComplete();

        ts.request(1); // make sure take() doesn't go unbounded
        ts.request(4);

        ts.assertValues(1, 2, 3, 4, 5);
        ts.assertNoErrors();
        ts.assertNotComplete();

            

Reported by PMD.

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

Line: 61

                      ts.assertNotComplete();

        ts.request(1); // make sure take() doesn't go unbounded
        ts.request(4);

        ts.assertValues(1, 2, 3, 4, 5);
        ts.assertNoErrors();
        ts.assertNotComplete();


            

Reported by PMD.

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

Line: 30

              import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableLastTest extends RxJavaTest {

    @Test
    public void lastWithElements() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());

            

Reported by PMD.

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

Line: 34

              
    @Test
    public void lastWithElements() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {

            

Reported by PMD.

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

Line: 35

                  @Test
    public void lastWithElements() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Observable.empty().lastElement();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 35

                  @Test
    public void lastWithElements() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Observable.empty().lastElement();

            

Reported by PMD.

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

Line: 35

                  @Test
    public void lastWithElements() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Observable.empty().lastElement();

            

Reported by PMD.

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

Line: 40

              
    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Observable.empty().lastElement();
        assertNull(last.blockingGet());
    }

    @Test
    public void lastMultiSubscribe() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 41

                  @Test
    public void lastWithNoElements() {
        Maybe<?> last = Observable.empty().lastElement();
        assertNull(last.blockingGet());
    }

    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();

            

Reported by PMD.

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

Line: 41

                  @Test
    public void lastWithNoElements() {
        Maybe<?> last = Observable.empty().lastElement();
        assertNull(last.blockingGet());
    }

    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();

            

Reported by PMD.

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

Line: 45

                  }

    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
        assertEquals(3, last.blockingGet().intValue());
    }


            

Reported by PMD.

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

Line: 46

              
    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Observable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test

            

Reported by PMD.

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

Line: 361

                              try {
                    assertEquals(1, qs.poll().intValue());
                } catch (Throwable ex) {
                    throw new RuntimeException(ex);
                }

                assertFalse(qs.isEmpty());

                qs.clear();

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 408

                              try {
                    assertEquals(1, qs.poll().intValue());
                } catch (Throwable ex) {
                    throw new RuntimeException(ex);
                }

                assertFalse(qs.isEmpty());

                qs.clear();

            

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 java.util.*;


            

Reported by PMD.

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

Line: 32

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

public class FlowableDoFinallyTest extends RxJavaTest implements Action {

    int calls;

    @Override
    public void run() throws Exception {

            

Reported by PMD.

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

Line: 34

              
public class FlowableDoFinallyTest extends RxJavaTest implements Action {

    int calls;

    @Override
    public void run() throws Exception {
        calls++;
    }

            

Reported by PMD.

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

Line: 43

              
    @Test
    public void normalJust() {
        Flowable.just(1)
        .doFinally(this)
        .test()
        .assertResult(1);

        assertEquals(1, calls);

            

Reported by PMD.

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

Line: 43

              
    @Test
    public void normalJust() {
        Flowable.just(1)
        .doFinally(this)
        .test()
        .assertResult(1);

        assertEquals(1, calls);

            

Reported by PMD.

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

Line: 43

              
    @Test
    public void normalJust() {
        Flowable.just(1)
        .doFinally(this)
        .test()
        .assertResult(1);

        assertEquals(1, calls);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 48

                      .test()
        .assertResult(1);

        assertEquals(1, calls);
    }

    @Test
    public void normalEmpty() {
        Flowable.empty()

            

Reported by PMD.

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

Line: 53

              
    @Test
    public void normalEmpty() {
        Flowable.empty()
        .doFinally(this)
        .test()
        .assertResult();

        assertEquals(1, calls);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/SingleFlattenStreamAsFlowableTest.java
137 issues
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 SingleFlattenStreamAsFlowableTest extends RxJavaTest {

    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsFlowable(Stream::of)

            

Reported by PMD.

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

Line: 40

              public class SingleFlattenStreamAsFlowableTest extends RxJavaTest {

    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsFlowable(Stream::of)
        .test()
        .assertResult(1);
    }

            

Reported by PMD.

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

Line: 41

              
    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsFlowable(Stream::of)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 41

              
    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsFlowable(Stream::of)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 41

              
    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsFlowable(Stream::of)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 48

                  }

    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsFlowable(v -> Stream.of())
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 49

              
    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsFlowable(v -> Stream.of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 49

              
    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsFlowable(v -> Stream.of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 49

              
    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsFlowable(v -> Stream.of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 56

                  }

    @Test
    public void successMany() {
        Single.just(1)
        .flattenStreamAsFlowable(v -> Stream.of(2, 3, 4, 5, 6))
        .test()
        .assertResult(2, 3, 4, 5, 6);
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableLastTest.java
137 issues
This class has too many methods, consider refactoring it.
Design

Line: 30

              import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class FlowableLastTest extends RxJavaTest {

    @Test
    public void lastWithElements() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());

            

Reported by PMD.

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

Line: 34

              
    @Test
    public void lastWithElements() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 35

                  @Test
    public void lastWithElements() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Flowable.empty().lastElement();

            

Reported by PMD.

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

Line: 35

                  @Test
    public void lastWithElements() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Flowable.empty().lastElement();

            

Reported by PMD.

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

Line: 35

                  @Test
    public void lastWithElements() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Flowable.empty().lastElement();

            

Reported by PMD.

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

Line: 40

              
    @Test
    public void lastWithNoElements() {
        Maybe<?> last = Flowable.empty().lastElement();
        assertNull(last.blockingGet());
    }

    @Test
    public void lastMultiSubscribe() {

            

Reported by PMD.

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

Line: 41

                  @Test
    public void lastWithNoElements() {
        Maybe<?> last = Flowable.empty().lastElement();
        assertNull(last.blockingGet());
    }

    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 41

                  @Test
    public void lastWithNoElements() {
        Maybe<?> last = Flowable.empty().lastElement();
        assertNull(last.blockingGet());
    }

    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();

            

Reported by PMD.

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

Line: 45

                  }

    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
        assertEquals(3, last.blockingGet().intValue());
    }


            

Reported by PMD.

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

Line: 46

              
    @Test
    public void lastMultiSubscribe() {
        Maybe<Integer> last = Flowable.just(1, 2, 3).lastElement();
        assertEquals(3, last.blockingGet().intValue());
        assertEquals(3, last.blockingGet().intValue());
    }

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/mixed/FlowableConcatMapMaybeTest.java
136 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.TimeUnit;

            

Reported by PMD.

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

Line: 40

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

public class FlowableConcatMapMaybeTest extends RxJavaTest {

    @Test
    public void simple() {
        Flowable.range(1, 5)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {

            

Reported by PMD.

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

Line: 43

              public class FlowableConcatMapMaybeTest extends RxJavaTest {

    @Test
    public void simple() {
        Flowable.range(1, 5)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {
            @Override
            public MaybeSource<Integer> apply(Integer v)
                    throws Exception {

            

Reported by PMD.

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

Line: 57

                  }

    @Test
    public void simpleLongPrefetch() {
        Flowable.range(1, 1024)
        .concatMapMaybe(Maybe::just, 32)
        .test()
        .assertValueCount(1024)
        .assertNoErrors()

            

Reported by PMD.

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

Line: 58

              
    @Test
    public void simpleLongPrefetch() {
        Flowable.range(1, 1024)
        .concatMapMaybe(Maybe::just, 32)
        .test()
        .assertValueCount(1024)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 58

              
    @Test
    public void simpleLongPrefetch() {
        Flowable.range(1, 1024)
        .concatMapMaybe(Maybe::just, 32)
        .test()
        .assertValueCount(1024)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 58

              
    @Test
    public void simpleLongPrefetch() {
        Flowable.range(1, 1024)
        .concatMapMaybe(Maybe::just, 32)
        .test()
        .assertValueCount(1024)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 58

              
    @Test
    public void simpleLongPrefetch() {
        Flowable.range(1, 1024)
        .concatMapMaybe(Maybe::just, 32)
        .test()
        .assertValueCount(1024)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 58

              
    @Test
    public void simpleLongPrefetch() {
        Flowable.range(1, 1024)
        .concatMapMaybe(Maybe::just, 32)
        .test()
        .assertValueCount(1024)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 67

                  }

    @Test
    public void simpleLongPrefetchHidden() {
        Flowable.range(1, 1024).hide()
        .concatMapMaybe(Maybe::just, 32)
        .test()
        .assertValueCount(1024)
        .assertNoErrors()

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableUsingTest.java
136 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 static org.mockito.Mockito.*;

import java.util.*;

            

Reported by PMD.

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

Line: 35

              import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableUsingTest extends RxJavaTest {

    interface Resource {
        String getTextFromWeb();

        void dispose();

            

Reported by PMD.

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

Line: 52

              
    }

    private final Consumer<Disposable> disposeSubscription = new Consumer<Disposable>() {

        @Override
        public void accept(Disposable d) {
            d.dispose();
        }

            

Reported by PMD.

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

Line: 62

                  };

    @Test
    public void using() {
        performTestUsing(false);
    }

    @Test
    public void usingEagerly() {

            

Reported by PMD.

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

Line: 67

                  }

    @Test
    public void usingEagerly() {
        performTestUsing(true);
    }

    private void performTestUsing(boolean disposeEagerly) {
        final Resource resource = mock(Resource.class);

            

Reported by PMD.

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

Line: 73

              
    private void performTestUsing(boolean disposeEagerly) {
        final Resource resource = mock(Resource.class);
        when(resource.getTextFromWeb()).thenReturn("Hello world!");

        Supplier<Resource> resourceFactory = new Supplier<Resource>() {
            @Override
            public Resource get() {
                return resource;

            

Reported by PMD.

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

Line: 73

              
    private void performTestUsing(boolean disposeEagerly) {
        final Resource resource = mock(Resource.class);
        when(resource.getTextFromWeb()).thenReturn("Hello world!");

        Supplier<Resource> resourceFactory = new Supplier<Resource>() {
            @Override
            public Resource get() {
                return resource;

            

Reported by PMD.

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

Line: 85

                      Function<Resource, Observable<String>> observableFactory = new Function<Resource, Observable<String>>() {
            @Override
            public Observable<String> apply(Resource res) {
                return Observable.fromArray(res.getTextFromWeb().split(" "));
            }
        };

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


            

Reported by PMD.

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

Line: 96

                      o.subscribe(observer);

        InOrder inOrder = inOrder(observer);
        inOrder.verify(observer, times(1)).onNext("Hello");
        inOrder.verify(observer, times(1)).onNext("world!");
        inOrder.verify(observer, times(1)).onComplete();
        inOrder.verifyNoMoreInteractions();

        // The resouce should be closed

            

Reported by PMD.

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

Line: 96

                      o.subscribe(observer);

        InOrder inOrder = inOrder(observer);
        inOrder.verify(observer, times(1)).onNext("Hello");
        inOrder.verify(observer, times(1)).onNext("world!");
        inOrder.verify(observer, times(1)).onComplete();
        inOrder.verifyNoMoreInteractions();

        // The resouce should be closed

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/mixed/ObservableConcatMapMaybeTest.java
135 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.TimeUnit;

            

Reported by PMD.

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

Line: 37

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

public class ObservableConcatMapMaybeTest extends RxJavaTest {

    @Test
    public void simple() {
        Observable.range(1, 5)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {

            

Reported by PMD.

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

Line: 40

              public class ObservableConcatMapMaybeTest extends RxJavaTest {

    @Test
    public void simple() {
        Observable.range(1, 5)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {
            @Override
            public MaybeSource<Integer> apply(Integer v)
                    throws Exception {

            

Reported by PMD.

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

Line: 54

                  }

    @Test
    public void simpleLong() {
        Observable.range(1, 1024)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {
            @Override
            public MaybeSource<Integer> apply(Integer v)
                    throws Exception {

            

Reported by PMD.

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

Line: 70

                  }

    @Test
    public void empty() {
        Observable.range(1, 10)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {
            @Override
            public MaybeSource<Integer> apply(Integer v)
                    throws Exception {

            

Reported by PMD.

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

Line: 84

                  }

    @Test
    public void mixed() {
        Observable.range(1, 10)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {
            @Override
            public MaybeSource<Integer> apply(Integer v)
                    throws Exception {

            

Reported by PMD.

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

Line: 101

                  }

    @Test
    public void mixedLong() {
        TestObserverEx<Integer> to = Observable.range(1, 1024)
        .concatMapMaybe(new Function<Integer, MaybeSource<Integer>>() {
            @Override
            public MaybeSource<Integer> apply(Integer v)
                    throws Exception {

            

Reported by PMD.

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

Line: 108

                          public MaybeSource<Integer> apply(Integer v)
                    throws Exception {
                if (v % 2 == 0) {
                    return Maybe.just(v).subscribeOn(Schedulers.computation());
                }
                return Maybe.<Integer>empty().subscribeOn(Schedulers.computation());
            }
        })
        .to(TestHelper.<Integer>testConsumer())

            

Reported by PMD.

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

Line: 110

                              if (v % 2 == 0) {
                    return Maybe.just(v).subscribeOn(Schedulers.computation());
                }
                return Maybe.<Integer>empty().subscribeOn(Schedulers.computation());
            }
        })
        .to(TestHelper.<Integer>testConsumer())
        .awaitDone(5, TimeUnit.SECONDS)
        .assertValueCount(512)

            

Reported by PMD.

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

Line: 110

                              if (v % 2 == 0) {
                    return Maybe.just(v).subscribeOn(Schedulers.computation());
                }
                return Maybe.<Integer>empty().subscribeOn(Schedulers.computation());
            }
        })
        .to(TestHelper.<Integer>testConsumer())
        .awaitDone(5, TimeUnit.SECONDS)
        .assertValueCount(512)

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatMapTest.java
135 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.util.List;
import java.util.concurrent.Callable;

            

Reported by PMD.

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

Line: 35

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

public class ObservableConcatMapTest extends RxJavaTest {

    @Test
    public void asyncFused() {
        UnicastSubject<Integer> us = UnicastSubject.create();


            

Reported by PMD.

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

Line: 38

              public class ObservableConcatMapTest extends RxJavaTest {

    @Test
    public void asyncFused() {
        UnicastSubject<Integer> us = UnicastSubject.create();

        TestObserver<Integer> to = us.concatMap(new Function<Integer, ObservableSource<Integer>>() {
            @Override
            public ObservableSource<Integer> apply(Integer v) throws Exception {

            

Reported by PMD.

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

Line: 49

                      })
        .test();

        us.onNext(1);
        us.onComplete();

        to.assertResult(1, 2);
    }


            

Reported by PMD.

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

Line: 50

                      .test();

        us.onNext(1);
        us.onComplete();

        to.assertResult(1, 2);
    }

    @Test

            

Reported by PMD.

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

Line: 56

                  }

    @Test
    public void dispose() {
        TestHelper.checkDisposed(Observable.<Integer>just(1).hide()
        .concatMap(new Function<Integer, ObservableSource<Integer>>() {
            @Override
            public ObservableSource<Integer> apply(Integer v) throws Exception {
                return Observable.error(new TestException());

            

Reported by PMD.

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

Line: 67

                  }

    @Test
    public void dispose2() {
        TestHelper.checkDisposed(Observable.<Integer>just(1).hide()
        .concatMapDelayError(new Function<Integer, ObservableSource<Integer>>() {
            @Override
            public ObservableSource<Integer> apply(Integer v) throws Exception {
                return Observable.error(new TestException());

            

Reported by PMD.

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

Line: 78

                  }

    @Test
    public void mainError() {
        Observable.<Integer>error(new TestException())
        .concatMap(new Function<Integer, ObservableSource<Integer>>() {
            @Override
            public ObservableSource<Integer> apply(Integer v) throws Exception {
                return Observable.range(v, 2);

            

Reported by PMD.

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

Line: 91

                  }

    @Test
    public void innerError() {
        Observable.<Integer>just(1).hide()
        .concatMap(new Function<Integer, ObservableSource<Integer>>() {
            @Override
            public ObservableSource<Integer> apply(Integer v) throws Exception {
                return Observable.error(new TestException());

            

Reported by PMD.

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

Line: 104

                  }

    @Test
    public void mainErrorDelayed() {
        Observable.<Integer>error(new TestException())
        .concatMapDelayError(new Function<Integer, ObservableSource<Integer>>() {
            @Override
            public ObservableSource<Integer> apply(Integer v) throws Exception {
                return Observable.range(v, 2);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCreateTest.java
134 issues
Avoid reassigning parameters such as 'e'
Design

Line: 127

              
        Observable.<Integer>create(new ObservableOnSubscribe<Integer>() {
            @Override
            public void subscribe(ObservableEmitter<Integer> e) throws Exception {
                e = e.serialize();

                e.setDisposable(d);

                e.onNext(1);

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 155

              
        Observable.<Integer>create(new ObservableOnSubscribe<Integer>() {
            @Override
            public void subscribe(ObservableEmitter<Integer> e) throws Exception {
                e = e.serialize();

                e.setDisposable(d);

                e.onNext(1);

            

Reported by PMD.

Avoid reassigning parameters such as 'e'
Design

Line: 247

              
        Observable.create(new ObservableOnSubscribe<Integer>() {
            @Override
            public void subscribe(ObservableEmitter<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: 639

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

            

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.io.IOException;
import java.util.List;

            

Reported by PMD.

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

Line: 33

              import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableCreateTest extends RxJavaTest {

    @Test
    @SuppressUndeliverable
    public void basic() {
        final Disposable d = Disposable.empty();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 58

                      .test()
        .assertResult(1, 2, 3);

        assertTrue(d.isDisposed());
    }

    @Test
    @SuppressUndeliverable
    public void basicWithCancellable() {

            

Reported by PMD.

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

Line: 58

                      .test()
        .assertResult(1, 2, 3);

        assertTrue(d.isDisposed());
    }

    @Test
    @SuppressUndeliverable
    public void basicWithCancellable() {

            

Reported by PMD.

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

Line: 63

              
    @Test
    @SuppressUndeliverable
    public void basicWithCancellable() {
        final Disposable d1 = Disposable.empty();
        final Disposable d2 = Disposable.empty();

        Observable.<Integer>create(new ObservableOnSubscribe<Integer>() {
            @Override

            

Reported by PMD.

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

Line: 91

                      .test()
        .assertResult(1, 2, 3);

        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());
    }

    @Test
    @SuppressUndeliverable

            

Reported by PMD.