Skip to content

Commit

Permalink
Use Mockito.anyLong() instead of any(Long.class)
Browse files Browse the repository at this point in the history
See b/34165691#comment16

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153873219
  • Loading branch information
ronshapiro committed Apr 24, 2017
1 parent ce263f7 commit 159a08c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions javatests/dagger/producers/monitoring/TimingRecordersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyLong;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.verifyNoMoreInteractions;
Expand Down Expand Up @@ -160,10 +161,10 @@ public void singleRecorder_throwingProducerTimingRecorderSuccess() {
setUpNormalSingleRecorder();
doThrow(new RuntimeException("monkey"))
.when(mockProducerTimingRecorder)
.recordMethod(any(Long.class), any(Long.class));
.recordMethod(anyLong(), anyLong());
doThrow(new RuntimeException("monkey"))
.when(mockProducerTimingRecorder)
.recordSuccess(any(Long.class));
.recordSuccess(anyLong());
ProductionComponentTimingRecorder.Factory factory =
TimingRecorders.delegatingProductionComponentTimingRecorderFactory(
ImmutableList.of(mockProductionComponentTimingRecorderFactory));
Expand Down Expand Up @@ -302,13 +303,13 @@ public void multipleRecorders_someThrowingProducerTimingRecordersSuccess() {
setUpNormalMultipleRecorders();
doThrow(new RuntimeException("monkey"))
.when(mockProducerTimingRecorderA)
.recordMethod(any(Long.class), any(Long.class));
.recordMethod(anyLong(), anyLong());
doThrow(new RuntimeException("monkey"))
.when(mockProducerTimingRecorderB)
.recordSuccess(any(Long.class));
.recordSuccess(anyLong());
doThrow(new RuntimeException("monkey"))
.when(mockProducerTimingRecorderC)
.recordMethod(any(Long.class), any(Long.class));
.recordMethod(anyLong(), anyLong());
ProductionComponentTimingRecorder.Factory factory =
TimingRecorders.delegatingProductionComponentTimingRecorderFactory(
ImmutableList.of(
Expand Down

0 comments on commit 159a08c

Please sign in to comment.