@@ -618,7 +618,8 @@ public void isFeatureEnabledWithExperimentKeyForced() throws Exception {
618618 assertTrue (optimizely .setForcedVariation (activatedExperiment .getKey (), testUserId , null ));
619619 assertNull (optimizely .getForcedVariation (activatedExperiment .getKey (), testUserId ));
620620 assertFalse (optimizely .isFeatureEnabled (FEATURE_FLAG_MULTI_VARIATE_FEATURE .getKey (), testUserId ));
621- eventHandler .expectImpression (null , "" , testUserId );
621+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
622+ eventHandler .expectImpression (null , null , testUserId );
622623 }
623624
624625 /**
@@ -1810,13 +1811,19 @@ public void getEnabledFeaturesWithListenerMultipleFeatureEnabled() throws Except
18101811 List <String > featureFlags = optimizely .getEnabledFeatures (testUserId , Collections .emptyMap ());
18111812 assertEquals (2 , featureFlags .size ());
18121813
1813- eventHandler .expectImpression (null , "" , testUserId );
1814- eventHandler .expectImpression (null , "" , testUserId );
1814+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1815+ eventHandler .expectImpression (null , null , testUserId );
1816+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1817+ eventHandler .expectImpression (null , null , testUserId );
18151818 eventHandler .expectImpression ("3794675122" , "589640735" , testUserId );
1816- eventHandler .expectImpression (null , "" , testUserId );
1817- eventHandler .expectImpression (null , "" , testUserId );
1818- eventHandler .expectImpression (null , "" , testUserId );
1819- eventHandler .expectImpression (null , "" , testUserId );
1819+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1820+ eventHandler .expectImpression (null , null , testUserId );
1821+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1822+ eventHandler .expectImpression (null , null , testUserId );
1823+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1824+ eventHandler .expectImpression (null , null , testUserId );
1825+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1826+ eventHandler .expectImpression (null , null , testUserId );
18201827 eventHandler .expectImpression ("1786133852" , "1619235542" , testUserId );
18211828
18221829 // Verify that listener being called
@@ -1853,14 +1860,22 @@ public void getEnabledFeaturesWithNoFeatureEnabled() throws Exception {
18531860 // Verify that listener not being called
18541861 assertFalse (isListenerCalled );
18551862
1856- eventHandler .expectImpression (null , "" , genericUserId );
1857- eventHandler .expectImpression (null , "" , genericUserId );
1858- eventHandler .expectImpression (null , "" , genericUserId );
1859- eventHandler .expectImpression (null , "" , genericUserId );
1860- eventHandler .expectImpression (null , "" , genericUserId );
1861- eventHandler .expectImpression (null , "" , genericUserId );
1862- eventHandler .expectImpression (null , "" , genericUserId );
1863- eventHandler .expectImpression (null , "" , genericUserId );
1863+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1864+ eventHandler .expectImpression (null , null , genericUserId );
1865+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1866+ eventHandler .expectImpression (null , null , genericUserId );
1867+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1868+ eventHandler .expectImpression (null , null , genericUserId );
1869+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1870+ eventHandler .expectImpression (null , null , genericUserId );
1871+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1872+ eventHandler .expectImpression (null , null , genericUserId );
1873+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1874+ eventHandler .expectImpression (null , null , genericUserId );
1875+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1876+ eventHandler .expectImpression (null , null , genericUserId );
1877+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
1878+ eventHandler .expectImpression (null , null , genericUserId );
18641879
18651880 assertTrue (optimizely .notificationCenter .removeNotificationListener (notificationId ));
18661881 }
@@ -2013,7 +2028,8 @@ public void isFeatureEnabledWithListenerUserNotInExperimentAndNotInRollOut() thr
20132028 "Feature \" " + validFeatureKey +
20142029 "\" is enabled for user \" " + genericUserId + "\" ? false"
20152030 );
2016- eventHandler .expectImpression (null , "" , genericUserId );
2031+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
2032+ eventHandler .expectImpression (null , null , genericUserId );
20172033
20182034 // Verify that listener being called
20192035 assertTrue (isListenerCalled );
@@ -3339,7 +3355,8 @@ public void isFeatureEnabledReturnsFalseWhenUserIsNotBucketedIntoAnyVariation()
33393355 "Feature \" " + validFeatureKey +
33403356 "\" is enabled for user \" " + genericUserId + "\" ? false"
33413357 );
3342- eventHandler .expectImpression (null , "" , genericUserId );
3358+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3359+ eventHandler .expectImpression (null , null , genericUserId );
33433360
33443361 verify (mockDecisionService ).getVariationForFeature (
33453362 eq (FEATURE_FLAG_MULTI_VARIATE_FEATURE ),
@@ -3384,7 +3401,8 @@ public void isFeatureEnabledReturnsTrueButDoesNotSendWhenUserIsBucketedIntoVaria
33843401 "Feature \" " + validFeatureKey +
33853402 "\" is enabled for user \" " + genericUserId + "\" ? true"
33863403 );
3387- eventHandler .expectImpression ("3421010877" , "variationId" , genericUserId );
3404+ // FSSDK-12813: non-numeric variation_id "variationId" is normalized to null on the wire.
3405+ eventHandler .expectImpression ("3421010877" , null , genericUserId );
33883406
33893407 verify (mockDecisionService ).getVariationForFeature (
33903408 eq (FEATURE_FLAG_MULTI_VARIATE_FEATURE ),
@@ -3456,7 +3474,8 @@ public void isFeatureEnabledTrueWhenFeatureEnabledOfVariationIsTrue() throws Exc
34563474 );
34573475
34583476 assertTrue (optimizely .isFeatureEnabled (validFeatureKey , genericUserId ));
3459- eventHandler .expectImpression ("3421010877" , "variationId" , genericUserId );
3477+ // FSSDK-12813: non-numeric variation_id "variationId" is normalized to null on the wire.
3478+ eventHandler .expectImpression ("3421010877" , null , genericUserId );
34603479
34613480 }
34623481
@@ -3485,7 +3504,8 @@ public void isFeatureEnabledFalseWhenFeatureEnabledOfVariationIsFalse() throws E
34853504 );
34863505
34873506 assertFalse (spyOptimizely .isFeatureEnabled (FEATURE_MULTI_VARIATE_FEATURE_KEY , genericUserId ));
3488- eventHandler .expectImpression ("3421010877" , "variationId" , genericUserId );
3507+ // FSSDK-12813: non-numeric variation_id "variationId" is normalized to null on the wire.
3508+ eventHandler .expectImpression ("3421010877" , null , genericUserId );
34893509
34903510 }
34913511
@@ -3582,10 +3602,13 @@ public void getEnabledFeatureWithValidUserId() throws Exception {
35823602 List <String > featureFlags = optimizely .getEnabledFeatures (genericUserId , Collections .emptyMap ());
35833603 assertFalse (featureFlags .isEmpty ());
35843604
3585- eventHandler .expectImpression (null , "" , genericUserId );
3586- eventHandler .expectImpression (null , "" , genericUserId );
3605+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3606+ eventHandler .expectImpression (null , null , genericUserId );
3607+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3608+ eventHandler .expectImpression (null , null , genericUserId );
35873609 eventHandler .expectImpression ("3794675122" , "589640735" , genericUserId );
3588- eventHandler .expectImpression (null , "" , genericUserId );
3610+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3611+ eventHandler .expectImpression (null , null , genericUserId );
35893612 eventHandler .expectImpression ("1785077004" , "1566407342" , genericUserId );
35903613 eventHandler .expectImpression ("828245624" , "3137445031" , genericUserId );
35913614 eventHandler .expectImpression ("828245624" , "3137445031" , genericUserId );
@@ -3606,10 +3629,11 @@ public void getEnabledFeatureWithEmptyUserId() throws Exception {
36063629 List <String > featureFlags = optimizely .getEnabledFeatures ("" , Collections .emptyMap ());
36073630 assertFalse (featureFlags .isEmpty ());
36083631
3609- eventHandler .expectImpression (null , "" , "" );
3610- eventHandler .expectImpression (null , "" , "" );
3632+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3633+ eventHandler .expectImpression (null , null , "" );
3634+ eventHandler .expectImpression (null , null , "" );
36113635 eventHandler .expectImpression ("3794675122" , "589640735" , "" );
3612- eventHandler .expectImpression (null , "" , "" );
3636+ eventHandler .expectImpression (null , null , "" );
36133637 eventHandler .expectImpression ("1785077004" , "1566407342" , "" );
36143638 eventHandler .expectImpression ("828245624" , "3137445031" , "" );
36153639 eventHandler .expectImpression ("828245624" , "3137445031" , "" );
@@ -3660,14 +3684,22 @@ public void getEnabledFeatureWithMockDecisionService() throws Exception {
36603684 List <String > featureFlags = optimizely .getEnabledFeatures (genericUserId , Collections .emptyMap ());
36613685 assertTrue (featureFlags .isEmpty ());
36623686
3663- eventHandler .expectImpression (null , "" , genericUserId );
3664- eventHandler .expectImpression (null , "" , genericUserId );
3665- eventHandler .expectImpression (null , "" , genericUserId );
3666- eventHandler .expectImpression (null , "" , genericUserId );
3667- eventHandler .expectImpression (null , "" , genericUserId );
3668- eventHandler .expectImpression (null , "" , genericUserId );
3669- eventHandler .expectImpression (null , "" , genericUserId );
3670- eventHandler .expectImpression (null , "" , genericUserId );
3687+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3688+ eventHandler .expectImpression (null , null , genericUserId );
3689+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3690+ eventHandler .expectImpression (null , null , genericUserId );
3691+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3692+ eventHandler .expectImpression (null , null , genericUserId );
3693+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3694+ eventHandler .expectImpression (null , null , genericUserId );
3695+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3696+ eventHandler .expectImpression (null , null , genericUserId );
3697+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3698+ eventHandler .expectImpression (null , null , genericUserId );
3699+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3700+ eventHandler .expectImpression (null , null , genericUserId );
3701+ // FSSDK-12813: empty-string variation_id is normalized to null on the wire.
3702+ eventHandler .expectImpression (null , null , genericUserId );
36713703 }
36723704
36733705 /**
0 commit comments