77
77
import static org .junit .Assert .assertNotEquals ;
78
78
import static org .junit .Assert .assertThat ;
79
79
import static org .junit .Assume .assumeTrue ;
80
- import static org .mockito .Matchers . anyObject ;
81
- import static org .mockito .Matchers .eq ;
80
+ import static org .mockito .ArgumentMatchers . any ;
81
+ import static org .mockito .ArgumentMatchers .eq ;
82
82
import static org .mockito .Mockito .mock ;
83
83
import static org .mockito .Mockito .spy ;
84
84
import static org .mockito .Mockito .verify ;
85
- import static org .mockito .Mockito .verifyZeroInteractions ;
85
+ import static org .mockito .Mockito .verifyNoInteractions ;
86
86
import static org .mockito .Mockito .when ;
87
87
88
88
@ RunWith (Parameterized .class )
@@ -131,7 +131,7 @@ public OptimizelyClientTest(int datafileVersion,String datafile){
131
131
optimizely = Optimizely .builder (datafile , eventHandler ).build ();
132
132
133
133
// set to return DecisionResponse with null variation by default (instead of null DecisionResponse)
134
- when (bucketer .bucket (anyObject (), anyObject (), anyObject ())).thenReturn (DecisionResponse .nullNoReasons ());
134
+ when (bucketer .bucket (any (), any (), any ())).thenReturn (DecisionResponse .nullNoReasons ());
135
135
136
136
if (datafileVersion ==3 ) {
137
137
Variation variation = optimizely .getProjectConfig ().getExperiments ().get (0 ).getVariations ().get (0 );
@@ -431,7 +431,7 @@ public void testGoodForcedTrack() {
431
431
432
432
optimizelyClient .track ("test_event" , GENERIC_USER_ID );
433
433
434
- verifyZeroInteractions (logger );
434
+ verifyNoInteractions (logger );
435
435
436
436
ArgumentCaptor <LogEvent > logEventArgumentCaptor = ArgumentCaptor .forClass (LogEvent .class );
437
437
try {
@@ -462,7 +462,7 @@ public void testGoodTrack() {
462
462
OptimizelyClient optimizelyClient = new OptimizelyClient (optimizely ,
463
463
logger );
464
464
optimizelyClient .track ("test_event" , GENERIC_USER_ID );
465
- verifyZeroInteractions (logger );
465
+ verifyNoInteractions (logger );
466
466
}
467
467
468
468
@ Test
@@ -484,7 +484,7 @@ public void onTrack(@Nonnull String eventKey, @Nonnull String userId, @Nonnull M
484
484
assertTrue (notificationId <= 0 );
485
485
assertFalse (optimizelyClient .getNotificationCenter ().removeNotificationListener (notificationId ));
486
486
assertEquals (false , numberOfCalls [0 ]);
487
- verifyZeroInteractions (logger );
487
+ verifyNoInteractions (logger );
488
488
489
489
}
490
490
@@ -512,7 +512,7 @@ public void onTrack(@Nonnull String eventKey, @Nonnull String userId, @Nonnull M
512
512
else {
513
513
assertEquals (true , numberOfCalls [0 ]);
514
514
}
515
- verifyZeroInteractions (logger );
515
+ verifyNoInteractions (logger );
516
516
517
517
}
518
518
@@ -524,7 +524,7 @@ public void testGoodTrackBucketing() {
524
524
Experiment experiment = optimizelyClient .getProjectConfig ().getExperimentsForEventKey ("test_event" ).get (0 );
525
525
attributes .put (BUCKETING_ATTRIBUTE , bucketingId );
526
526
optimizelyClient .track ("test_event" , "userId" , attributes );
527
- verifyZeroInteractions (logger );
527
+ verifyNoInteractions (logger );
528
528
}
529
529
530
530
@ Test
@@ -569,7 +569,7 @@ public void testGoodForcedTrackAttribute() {
569
569
570
570
optimizelyClient .track ("test_event" , GENERIC_USER_ID , attributes );
571
571
572
- verifyZeroInteractions (logger );
572
+ verifyNoInteractions (logger );
573
573
574
574
ArgumentCaptor <LogEvent > logEventArgumentCaptor = ArgumentCaptor .forClass (LogEvent .class );
575
575
@@ -611,7 +611,7 @@ public void testGoodTrackAttribute() {
611
611
612
612
optimizelyClient .track ("test_event" , GENERIC_USER_ID , attributes );
613
613
614
- verifyZeroInteractions (logger );
614
+ verifyNoInteractions (logger );
615
615
616
616
Variation v = optimizelyClient .getForcedVariation (FEATURE_ANDROID_EXPERIMENT_KEY , GENERIC_USER_ID );
617
617
assertEquals (v .getKey (), "var_2" );
@@ -671,7 +671,7 @@ public void testGoodForcedTrackEventVal() {
671
671
Collections .<String , String >emptyMap (),
672
672
Collections .singletonMap (ReservedEventKey .REVENUE .toString (), 1L ));
673
673
674
- verifyZeroInteractions (logger );
674
+ verifyNoInteractions (logger );
675
675
676
676
ArgumentCaptor <LogEvent > logEventArgumentCaptor = ArgumentCaptor .forClass (LogEvent .class );
677
677
@@ -705,7 +705,7 @@ public void testGoodTrackEventVal() {
705
705
GENERIC_USER_ID ,
706
706
Collections .<String , String >emptyMap (),
707
707
Collections .singletonMap (ReservedEventKey .REVENUE .toString (), 1L ));
708
- verifyZeroInteractions (logger );
708
+ verifyNoInteractions (logger );
709
709
}
710
710
711
711
@ Test
@@ -750,7 +750,7 @@ public void testGoodTrackAttributeEventVal() {
750
750
final HashMap <String , String > attributes = new HashMap <>();
751
751
optimizelyClient .track ("test_event" , GENERIC_USER_ID , attributes ,
752
752
Collections .singletonMap (ReservedEventKey .REVENUE .toString (), 1L ));
753
- verifyZeroInteractions (logger );
753
+ verifyNoInteractions (logger );
754
754
}
755
755
756
756
@ Test
@@ -770,7 +770,7 @@ public void testGoodForcedTrackAttributeEventVal() {
770
770
attributes ,
771
771
Collections .singletonMap (ReservedEventKey .REVENUE .toString (), 1L ));
772
772
773
- verifyZeroInteractions (logger );
773
+ verifyNoInteractions (logger );
774
774
775
775
ArgumentCaptor <LogEvent > logEventArgumentCaptor = ArgumentCaptor .forClass (LogEvent .class );
776
776
@@ -839,7 +839,7 @@ public void testTrackWithEventTags() {
839
839
final HashMap <String , Object > eventTags = new HashMap <>();
840
840
eventTags .put ("foo" , 843 );
841
841
optimizelyClient .track ("test_event" , GENERIC_USER_ID , attributes , eventTags );
842
- verifyZeroInteractions (logger );
842
+ verifyNoInteractions (logger );
843
843
}
844
844
845
845
@ Test
@@ -875,7 +875,7 @@ public void testForcedTrackWithEventTags() {
875
875
// id of var_2
876
876
assertTrue (logEvent .getBody ().contains ("\" enrich_decisions\" :true" ));
877
877
878
- verifyZeroInteractions (logger );
878
+ verifyNoInteractions (logger );
879
879
880
880
Variation v = optimizelyClient .getForcedVariation (FEATURE_ANDROID_EXPERIMENT_KEY , GENERIC_USER_ID );
881
881
assertEquals (v .getKey (), "var_2" );
@@ -979,7 +979,7 @@ public void testGoodGetVariationAttribute() {
979
979
logger );
980
980
final HashMap <String , String > attributes = new HashMap <>();
981
981
optimizelyClient .getVariation (FEATURE_ANDROID_EXPERIMENT_KEY , GENERIC_USER_ID , attributes );
982
- verifyZeroInteractions (logger );
982
+ verifyNoInteractions (logger );
983
983
}
984
984
985
985
@ Test
@@ -996,7 +996,7 @@ public void testGoodForcedGetVariationAttribute() {
996
996
997
997
v = optimizelyClient .getVariation (FEATURE_ANDROID_EXPERIMENT_KEY , GENERIC_USER_ID , attributes );
998
998
999
- verifyZeroInteractions (logger );
999
+ verifyNoInteractions (logger );
1000
1000
1001
1001
assertEquals (v .getKey (), "var_2" );
1002
1002
@@ -1180,7 +1180,7 @@ public void testGoodIsFeatureEnabledWithAttribute() {
1180
1180
Collections .singletonMap ("house" , "Gryffindor" )
1181
1181
));
1182
1182
1183
- verifyZeroInteractions (logger );
1183
+ verifyNoInteractions (logger );
1184
1184
1185
1185
assertFalse (optimizelyClient .isFeatureEnabled (
1186
1186
"InvalidFeatureKey" ,
@@ -1301,7 +1301,7 @@ public void testIsFeatureEnabledWithFeatureEnabledTrue(){
1301
1301
Collections .singletonMap ("house" , "Gryffindor" )
1302
1302
));
1303
1303
1304
- verifyZeroInteractions (logger );
1304
+ verifyNoInteractions (logger );
1305
1305
1306
1306
}
1307
1307
@@ -1398,7 +1398,7 @@ public void testGoodGetFeatureVariableBooleanWithAttr() {
1398
1398
GENERIC_USER_ID ,
1399
1399
Collections .singletonMap ("key" , "value" )
1400
1400
));
1401
- verifyZeroInteractions (logger );
1401
+ verifyNoInteractions (logger );
1402
1402
1403
1403
}
1404
1404
@@ -1505,7 +1505,7 @@ public void testGoodGetFeatureVariableDoubleWithAttr() {
1505
1505
GENERIC_USER_ID ,
1506
1506
Collections .singletonMap ("house" , "Gryffindor" )
1507
1507
));
1508
- verifyZeroInteractions (logger );
1508
+ verifyNoInteractions (logger );
1509
1509
}
1510
1510
1511
1511
//FeatureVariableDouble Scenario#3 if feature not found
@@ -1616,7 +1616,7 @@ public void testGoodGetFeatureVariableIntegerWithAttr() {
1616
1616
GENERIC_USER_ID ,
1617
1617
Collections .singletonMap ("house" , "Gryffindor" )
1618
1618
));
1619
- verifyZeroInteractions (logger );
1619
+ verifyNoInteractions (logger );
1620
1620
}
1621
1621
1622
1622
//FeatureVariableInteger Scenario#3 if feature not found
@@ -1723,7 +1723,7 @@ public void testGoodGetFeatureVariableStringWithAttr() {
1723
1723
GENERIC_USER_ID ,
1724
1724
Collections .singletonMap ("house" , "Gryffindor" )
1725
1725
));
1726
- verifyZeroInteractions (logger );
1726
+ verifyNoInteractions (logger );
1727
1727
}
1728
1728
1729
1729
//FeatureVariableString Scenario#3 if feature not found
@@ -1837,7 +1837,7 @@ public void testGetFeatureVariableJsonWithAttr() {
1837
1837
);
1838
1838
1839
1839
assertTrue (compareJsonStrings (json .toString (), defaultValueOfStringVar ));
1840
- verifyZeroInteractions (logger );
1840
+ verifyNoInteractions (logger );
1841
1841
}
1842
1842
1843
1843
//FeatureVariableJSON Scenario#3 if feature not found
@@ -1949,7 +1949,7 @@ public void testGetAllFeatureVariablesWithAttr() {
1949
1949
);
1950
1950
1951
1951
assertTrue (compareJsonStrings (json .toString (), defaultValueOfStringVar ));
1952
- verifyZeroInteractions (logger );
1952
+ verifyNoInteractions (logger );
1953
1953
}
1954
1954
1955
1955
//GetAllFeatureVariables Scenario#3 if feature not found
0 commit comments