@@ -566,7 +566,7 @@ public void getVariationsForFeatureListBatchesUpsLoadAndSave() throws Exception
566566 ErrorHandler mockErrorHandler = mock (ErrorHandler .class );
567567 UserProfileService mockUserProfileService = mock (UserProfileService .class );
568568
569- DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , mockUserProfileService , null );
569+ DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , mockUserProfileService , mockCmabService );
570570
571571 FeatureFlag featureFlag1 = FEATURE_FLAG_MULTI_VARIATE_FEATURE ;
572572 FeatureFlag featureFlag2 = FEATURE_FLAG_MULTI_VARIATE_FUTURE_FEATURE ;
@@ -626,7 +626,7 @@ public void getVariationForFeatureInRolloutReturnsNullWhenUserIsExcludedFromAllT
626626 mockBucketer ,
627627 mockErrorHandler ,
628628 null ,
629- null
629+ mockCmabService
630630 );
631631
632632 FeatureDecision featureDecision = decisionService .getVariationForFeatureInRollout (
@@ -653,7 +653,7 @@ public void getVariationForFeatureInRolloutReturnsNullWhenUserFailsAllAudiencesA
653653 Bucketer mockBucketer = mock (Bucketer .class );
654654 when (mockBucketer .bucket (any (Experiment .class ), anyString (), any (ProjectConfig .class ))).thenReturn (DecisionResponse .nullNoReasons ());
655655
656- DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , null );
656+ DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , mockCmabService );
657657
658658 FeatureDecision featureDecision = decisionService .getVariationForFeatureInRollout (
659659 FEATURE_FLAG_MULTI_VARIATE_FEATURE ,
@@ -684,7 +684,7 @@ public void getVariationForFeatureInRolloutReturnsVariationWhenUserFailsAllAudie
684684 mockBucketer ,
685685 mockErrorHandler ,
686686 null ,
687- null
687+ mockCmabService
688688 );
689689
690690 FeatureDecision featureDecision = decisionService .getVariationForFeatureInRollout (
@@ -726,7 +726,7 @@ public void getVariationForFeatureInRolloutReturnsVariationWhenUserFailsTrafficI
726726 mockBucketer ,
727727 mockErrorHandler ,
728728 null ,
729- null
729+ mockCmabService
730730 );
731731
732732 FeatureDecision featureDecision = decisionService .getVariationForFeatureInRollout (
@@ -767,7 +767,7 @@ public void getVariationForFeatureInRolloutReturnsVariationWhenUserFailsTrafficI
767767 mockBucketer ,
768768 mockErrorHandler ,
769769 null ,
770- null
770+ mockCmabService
771771 );
772772
773773 FeatureDecision featureDecision = decisionService .getVariationForFeatureInRollout (
@@ -806,7 +806,7 @@ public void getVariationForFeatureInRolloutReturnsVariationWhenUserFailsTargetin
806806 when (mockBucketer .bucket (eq (everyoneElseRule ), anyString (), any (ProjectConfig .class ))).thenReturn (DecisionResponse .responseNoReasons (everyoneElseVariation ));
807807 when (mockBucketer .bucket (eq (englishCitizensRule ), anyString (), any (ProjectConfig .class ))).thenReturn (DecisionResponse .responseNoReasons (englishCitizenVariation ));
808808
809- DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , null );
809+ DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , mockCmabService );
810810
811811 FeatureDecision featureDecision = decisionService .getVariationForFeatureInRollout (
812812 FEATURE_FLAG_MULTI_VARIATE_FEATURE ,
@@ -959,7 +959,7 @@ public void bucketReturnsVariationStoredInUserProfile() throws Exception {
959959 when (userProfileService .lookup (userProfileId )).thenReturn (userProfile .toMap ());
960960
961961 Bucketer bucketer = new Bucketer ();
962- DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , null );
962+ DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , mockCmabService );
963963
964964 logbackVerifier .expectMessage (Level .INFO ,
965965 "Returning previously activated variation \" " + variation .getKey () + "\" of experiment \" " + experiment .getKey () + "\" "
@@ -985,7 +985,7 @@ public void getStoredVariationLogsWhenLookupReturnsNull() throws Exception {
985985 UserProfile userProfile = new UserProfile (userProfileId , Collections .<String , Decision >emptyMap ());
986986 when (userProfileService .lookup (userProfileId )).thenReturn (userProfile .toMap ());
987987
988- DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , null );
988+ DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , mockCmabService );
989989
990990 logbackVerifier .expectMessage (Level .INFO , "No previously activated variation of experiment " +
991991 "\" " + experiment .getKey () + "\" for user \" " + userProfileId + "\" found in user profile." );
@@ -1012,7 +1012,7 @@ public void getStoredVariationReturnsNullWhenVariationIsNoLongerInConfig() throw
10121012 UserProfileService userProfileService = mock (UserProfileService .class );
10131013 when (userProfileService .lookup (userProfileId )).thenReturn (storedUserProfile .toMap ());
10141014
1015- DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , null );
1015+ DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , mockCmabService );
10161016
10171017 logbackVerifier .expectMessage (Level .INFO ,
10181018 "User \" " + userProfileId + "\" was previously bucketed into variation with ID \" " + storedVariationId + "\" for " +
@@ -1043,7 +1043,7 @@ public void getVariationSavesBucketedVariationIntoUserProfile() throws Exception
10431043 Bucketer mockBucketer = mock (Bucketer .class );
10441044 when (mockBucketer .bucket (eq (experiment ), eq (userProfileId ), eq (noAudienceProjectConfig ))).thenReturn (DecisionResponse .responseNoReasons (variation ));
10451045
1046- DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , userProfileService , null );
1046+ DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , userProfileService , mockCmabService );
10471047
10481048 assertEquals (variation , decisionService .getVariation (
10491049 experiment , optimizely .createUserContext (userProfileId , Collections .emptyMap ()), noAudienceProjectConfig ).getResult ()
@@ -1105,7 +1105,7 @@ public void getVariationSavesANewUserProfile() throws Exception {
11051105
11061106 Bucketer bucketer = mock (Bucketer .class );
11071107 UserProfileService userProfileService = mock (UserProfileService .class );
1108- DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , null );
1108+ DecisionService decisionService = new DecisionService (bucketer , mockErrorHandler , userProfileService , mockCmabService );
11091109
11101110 when (bucketer .bucket (eq (experiment ), eq (userProfileId ), eq (noAudienceProjectConfig ))).thenReturn (DecisionResponse .responseNoReasons (variation ));
11111111 when (userProfileService .lookup (userProfileId )).thenReturn (null );
@@ -1117,7 +1117,7 @@ public void getVariationSavesANewUserProfile() throws Exception {
11171117 @ Test
11181118 public void getVariationBucketingId () throws Exception {
11191119 Bucketer bucketer = mock (Bucketer .class );
1120- DecisionService decisionService = spy (new DecisionService (bucketer , mockErrorHandler , null , null ));
1120+ DecisionService decisionService = spy (new DecisionService (bucketer , mockErrorHandler , null , mockCmabService ));
11211121 Experiment experiment = validProjectConfig .getExperiments ().get (0 );
11221122 Variation expectedVariation = experiment .getVariations ().get (0 );
11231123
@@ -1152,7 +1152,7 @@ public void getVariationForRolloutWithBucketingId() {
11521152 bucketer ,
11531153 mockErrorHandler ,
11541154 null ,
1155- null
1155+ mockCmabService
11561156 ));
11571157
11581158 FeatureDecision expectedFeatureDecision = new FeatureDecision (
@@ -1307,7 +1307,7 @@ public void getVariationForFeatureReturnHoldoutDecisionForGlobalHoldout() {
13071307
13081308 Bucketer mockBucketer = new Bucketer ();
13091309
1310- DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , null );
1310+ DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , mockCmabService );
13111311
13121312 Map <String , Object > attributes = new HashMap <>();
13131313 attributes .put ("$opt_bucketing_id" , "ppid160000" );
@@ -1353,7 +1353,7 @@ public void excludedFlagsHoldoutAppliesToAllExceptSpecified() {
13531353
13541354 Bucketer mockBucketer = new Bucketer ();
13551355
1356- DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , null );
1356+ DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , mockCmabService );
13571357
13581358 Map <String , Object > attributes = new HashMap <>();
13591359 attributes .put ("$opt_bucketing_id" , "ppid300002" );
@@ -1384,7 +1384,7 @@ public void userMeetsHoldoutAudienceConditions() {
13841384
13851385 Bucketer mockBucketer = new Bucketer ();
13861386
1387- DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , null );
1387+ DecisionService decisionService = new DecisionService (mockBucketer , mockErrorHandler , null , mockCmabService );
13881388
13891389 Map <String , Object > attributes = new HashMap <>();
13901390 attributes .put ("$opt_bucketing_id" , "ppid543400" );
0 commit comments