Skip to content

Commit

Permalink
Move test member AtomicReferences into the specific test
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Wysocki committed Sep 22, 2017
1 parent 45e6c31 commit 7270758
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ public class AutoDisposeCompletableObserverTest {
}
};

private final AtomicReference<CompletableObserver> atomicObserver = new AtomicReference<>();
private final AtomicReference<CompletableObserver> atomicAutoDisposingObserver = new AtomicReference<>();

@After public void resetPlugins() {
AutoDisposePlugins.reset();
}
Expand Down Expand Up @@ -289,6 +286,8 @@ public class AutoDisposeCompletableObserverTest {
}

@Test public void verifyObserverDelegate() {
final AtomicReference<CompletableObserver> atomicObserver = new AtomicReference<>();
final AtomicReference<CompletableObserver> atomicAutoDisposingObserver = new AtomicReference<>();
try {
RxJavaPlugins.setOnCompletableSubscribe(new BiFunction<Completable, CompletableObserver, CompletableObserver>() {
@Override public CompletableObserver apply(Completable source, CompletableObserver observer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ public class AutoDisposeMaybeObserverTest {
}
};

private final AtomicReference<MaybeObserver> atomicObserver = new AtomicReference<>();
private final AtomicReference<MaybeObserver> atomicAutoDisposingObserver = new AtomicReference<>();


@After public void resetPlugins() {
AutoDisposePlugins.reset();
}
Expand Down Expand Up @@ -336,6 +332,8 @@ public class AutoDisposeMaybeObserverTest {
}

@Test public void verifyObserverDelegate() {
final AtomicReference<MaybeObserver> atomicObserver = new AtomicReference<>();
final AtomicReference<MaybeObserver> atomicAutoDisposingObserver = new AtomicReference<>();
try {
RxJavaPlugins.setOnMaybeSubscribe(new BiFunction<Maybe, MaybeObserver, MaybeObserver>() {
@Override public MaybeObserver apply(Maybe source, MaybeObserver observer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public class AutoDisposeObserverTest {
}
};

private final AtomicReference<Observer> atomicObserver = new AtomicReference();
private final AtomicReference<Observer> atomicAutoDisposingObserver = new AtomicReference<>();

@After public void resetPlugins() {
AutoDisposePlugins.reset();
}
Expand Down Expand Up @@ -265,6 +262,8 @@ public class AutoDisposeObserverTest {
}

@Test public void verifyObserverDelegate() {
final AtomicReference<Observer> atomicObserver = new AtomicReference();
final AtomicReference<Observer> atomicAutoDisposingObserver = new AtomicReference();
try {
RxJavaPlugins.setOnObservableSubscribe(new BiFunction<Observable, Observer, Observer>() {
@Override public Observer apply(Observable source, Observer observer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.uber.autodispose.test.RecordingObserver;
import com.uber.autodispose.observers.AutoDisposingSingleObserver;

import io.reactivex.Maybe;
import io.reactivex.Single;
import io.reactivex.SingleEmitter;
Expand Down Expand Up @@ -51,9 +50,6 @@ public class AutoDisposeSingleObserverTest {
}
};

private final AtomicReference<SingleObserver> atomicObserver = new AtomicReference<>();
private final AtomicReference<SingleObserver> atomicAutoDisposingObserver = new AtomicReference<>();

@After public void resetPlugins() {
AutoDisposePlugins.reset();
}
Expand Down Expand Up @@ -303,6 +299,8 @@ public class AutoDisposeSingleObserverTest {
}

@Test public void verifyObserverDelegate() {
final AtomicReference<SingleObserver> atomicObserver = new AtomicReference<>();
final AtomicReference<SingleObserver> atomicAutoDisposingObserver = new AtomicReference<>();
try {
RxJavaPlugins.setOnSingleSubscribe(new BiFunction<Single, SingleObserver, SingleObserver>() {
@Override public SingleObserver apply(Single source, SingleObserver observer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@

public class AutoDisposeSubscriberTest {

private final AtomicReference<Subscriber> atomicSubscriber = new AtomicReference<>();
private final AtomicReference<Subscriber> atomicAutoDisposingSubscriber = new AtomicReference<>();

@After public void resetPlugins() {
AutoDisposePlugins.reset();
}
Expand Down Expand Up @@ -277,6 +274,8 @@ public class AutoDisposeSubscriberTest {
}

@Test public void verifySubscriberDelegate() {
final AtomicReference<Subscriber> atomicSubscriber = new AtomicReference<>();
final AtomicReference<Subscriber> atomicAutoDisposingSubscriber = new AtomicReference<>();
try {
RxJavaPlugins.setOnFlowableSubscribe(new BiFunction<Flowable, Subscriber, Subscriber>() {
@Override public Subscriber apply(Flowable source, Subscriber subscriber) {
Expand Down

0 comments on commit 7270758

Please sign in to comment.