Skip to content

Commit d70e1d6

Browse files
committed
Solve the conflict of 'any' method name in unit tests
1 parent cb96d7d commit d70e1d6

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

rxjava-core/src/main/java/rx/subjects/AsyncSubject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void testCompleted() {
168168
private void assertCompletedObserver(Observer<String> aObserver)
169169
{
170170
verify(aObserver, times(1)).onNext("three");
171-
verify(aObserver, Mockito.never()).onError(any(Throwable.class));
171+
verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
172172
verify(aObserver, times(1)).onCompleted();
173173
}
174174

@@ -221,7 +221,7 @@ public void testUnsubscribeBeforeCompleted() {
221221
private void assertNoOnNextEventsReceived(Observer<String> aObserver)
222222
{
223223
verify(aObserver, Mockito.never()).onNext(anyString());
224-
verify(aObserver, Mockito.never()).onError(any(Throwable.class));
224+
verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
225225
verify(aObserver, Mockito.never()).onCompleted();
226226
}
227227

rxjava-core/src/main/java/rx/subjects/BehaviorSubject.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package rx.subjects;
1717

18-
import static org.mockito.Matchers.*;
1918
import static org.mockito.Mockito.*;
2019

2120
import java.util.concurrent.ConcurrentHashMap;
@@ -199,7 +198,7 @@ private void assertCompletedObserver(Observer<String> aObserver)
199198
{
200199
verify(aObserver, times(1)).onNext("default");
201200
verify(aObserver, times(1)).onNext("one");
202-
verify(aObserver, Mockito.never()).onError(any(Throwable.class));
201+
verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
203202
verify(aObserver, times(1)).onCompleted();
204203
}
205204

rxjava-core/src/main/java/rx/subjects/PublishSubject.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package rx.subjects;
1717

1818
import static org.junit.Assert.*;
19-
import static org.mockito.Matchers.*;
2019
import static org.mockito.Mockito.*;
2120

2221
import java.util.ArrayList;
@@ -273,7 +272,7 @@ private void assertCompletedObserver(Observer<String> aObserver)
273272
verify(aObserver, times(1)).onNext("one");
274273
verify(aObserver, times(1)).onNext("two");
275274
verify(aObserver, times(1)).onNext("three");
276-
verify(aObserver, Mockito.never()).onError(any(Throwable.class));
275+
verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
277276
verify(aObserver, times(1)).onCompleted();
278277
}
279278

@@ -340,7 +339,7 @@ private void assertCompletedStartingWithThreeObserver(Observer<String> aObserver
340339
verify(aObserver, Mockito.never()).onNext("one");
341340
verify(aObserver, Mockito.never()).onNext("two");
342341
verify(aObserver, times(1)).onNext("three");
343-
verify(aObserver, Mockito.never()).onError(any(Throwable.class));
342+
verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
344343
verify(aObserver, times(1)).onCompleted();
345344
}
346345

@@ -374,7 +373,7 @@ private void assertObservedUntilTwo(Observer<String> aObserver)
374373
verify(aObserver, times(1)).onNext("one");
375374
verify(aObserver, times(1)).onNext("two");
376375
verify(aObserver, Mockito.never()).onNext("three");
377-
verify(aObserver, Mockito.never()).onError(any(Throwable.class));
376+
verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
378377
verify(aObserver, Mockito.never()).onCompleted();
379378
}
380379

@@ -404,7 +403,7 @@ public void testUnsubscribeAfterOnCompleted() {
404403
inOrder.verify(anObserver, times(1)).onNext("one");
405404
inOrder.verify(anObserver, times(1)).onNext("two");
406405
inOrder.verify(anObserver, times(1)).onCompleted();
407-
inOrder.verify(anObserver, Mockito.never()).onError(any(Throwable.class));
406+
inOrder.verify(anObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
408407

409408
@SuppressWarnings("unchecked")
410409
Observer<String> anotherObserver = mock(Observer.class);
@@ -414,7 +413,7 @@ public void testUnsubscribeAfterOnCompleted() {
414413
inOrder.verify(anotherObserver, Mockito.never()).onNext("one");
415414
inOrder.verify(anotherObserver, Mockito.never()).onNext("two");
416415
inOrder.verify(anotherObserver, times(1)).onCompleted();
417-
inOrder.verify(anotherObserver, Mockito.never()).onError(any(Throwable.class));
416+
inOrder.verify(anotherObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
418417
}
419418

420419
@Test

rxjava-core/src/main/java/rx/subjects/ReplaySubject.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package rx.subjects;
1717

18-
import static org.mockito.Matchers.*;
1918
import static org.mockito.Mockito.*;
2019

2120
import java.util.ArrayList;
@@ -215,7 +214,7 @@ private void assertCompletedObserver(Observer<String> aObserver)
215214
inOrder.verify(aObserver, times(1)).onNext("one");
216215
inOrder.verify(aObserver, times(1)).onNext("two");
217216
inOrder.verify(aObserver, times(1)).onNext("three");
218-
inOrder.verify(aObserver, Mockito.never()).onError(any(Throwable.class));
217+
inOrder.verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
219218
inOrder.verify(aObserver, times(1)).onCompleted();
220219
inOrder.verifyNoMoreInteractions();
221220
}
@@ -307,7 +306,7 @@ private void assertObservedUntilTwo(Observer<String> aObserver)
307306
verify(aObserver, times(1)).onNext("one");
308307
verify(aObserver, times(1)).onNext("two");
309308
verify(aObserver, Mockito.never()).onNext("three");
310-
verify(aObserver, Mockito.never()).onError(any(Throwable.class));
309+
verify(aObserver, Mockito.never()).onError(org.mockito.Matchers.any(Throwable.class));
311310
verify(aObserver, Mockito.never()).onCompleted();
312311
}
313312

0 commit comments

Comments
 (0)