|
68 | 68 |
|
69 | 69 | @RunWith(Parameterized.class) |
70 | 70 | public class OptimizelyClientTest { |
| 71 | + static String BUCKETING_ATTRIBUTE = "$opt_bucketing_id"; |
| 72 | + |
71 | 73 | @Parameterized.Parameters |
72 | 74 | public static Collection<Object[]> data() throws IOException { |
73 | 75 | return Arrays.asList(new Object[][] { |
@@ -311,7 +313,7 @@ public void testGoodActivationBucketingId() { |
311 | 313 | final HashMap<String, String> attributes = new HashMap<>(); |
312 | 314 | String bucketingId = "1"; |
313 | 315 | Experiment experiment = optimizelyClient.getProjectConfig().getExperimentKeyMapping().get(FEATURE_ANDROID_EXPERIMENT_KEY); |
314 | | - attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId); |
| 316 | + attributes.put(BUCKETING_ATTRIBUTE, bucketingId); |
315 | 317 | Variation v = optimizelyClient.activate(FEATURE_ANDROID_EXPERIMENT_KEY, GENERIC_USER_ID, attributes); |
316 | 318 | verify(bucketer).bucket( experiment, bucketingId); |
317 | 319 | } |
@@ -453,7 +455,7 @@ public void testGoodTrackBucketing() { |
453 | 455 | Map<String,String> attributes = new HashMap<>(); |
454 | 456 | String bucketingId = "1"; |
455 | 457 | Experiment experiment = optimizelyClient.getProjectConfig().getExperimentsForEventKey("test_event").get(0); |
456 | | - attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId); |
| 458 | + attributes.put(BUCKETING_ATTRIBUTE, bucketingId); |
457 | 459 | optimizelyClient.track("test_event", "userId", attributes); |
458 | 460 | verify(bucketer).bucket(experiment, bucketingId); |
459 | 461 | verifyZeroInteractions(logger); |
@@ -853,7 +855,7 @@ public void testGoodGetVariationBucketingId() { |
853 | 855 | Experiment experiment = optimizelyClient.getProjectConfig().getExperimentKeyMapping().get("android_experiment_key"); |
854 | 856 | String bucketingId = "1"; |
855 | 857 | Map<String, String> attributes = new HashMap<>(); |
856 | | - attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId); |
| 858 | + attributes.put(BUCKETING_ATTRIBUTE, bucketingId); |
857 | 859 | Variation v = optimizelyClient.getVariation("android_experiment_key", "userId", attributes); |
858 | 860 | verify(bucketer).bucket(experiment, bucketingId); |
859 | 861 | } |
|
0 commit comments