diff --git a/android-sdk/src/androidTest/java/com/optimizely/ab/android/sdk/OptimizelyClientTest.java b/android-sdk/src/androidTest/java/com/optimizely/ab/android/sdk/OptimizelyClientTest.java index 68ec07516..7e18631d6 100644 --- a/android-sdk/src/androidTest/java/com/optimizely/ab/android/sdk/OptimizelyClientTest.java +++ b/android-sdk/src/androidTest/java/com/optimizely/ab/android/sdk/OptimizelyClientTest.java @@ -68,6 +68,8 @@ @RunWith(Parameterized.class) public class OptimizelyClientTest { + static String BUCKETING_ATTRIBUTE = "$opt_bucketing_id"; + @Parameterized.Parameters public static Collection data() throws IOException { return Arrays.asList(new Object[][] { @@ -311,7 +313,7 @@ public void testGoodActivationBucketingId() { final HashMap attributes = new HashMap<>(); String bucketingId = "1"; Experiment experiment = optimizelyClient.getProjectConfig().getExperimentKeyMapping().get(FEATURE_ANDROID_EXPERIMENT_KEY); - attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId); + attributes.put(BUCKETING_ATTRIBUTE, bucketingId); Variation v = optimizelyClient.activate(FEATURE_ANDROID_EXPERIMENT_KEY, GENERIC_USER_ID, attributes); verify(bucketer).bucket( experiment, bucketingId); } @@ -453,7 +455,7 @@ public void testGoodTrackBucketing() { Map attributes = new HashMap<>(); String bucketingId = "1"; Experiment experiment = optimizelyClient.getProjectConfig().getExperimentsForEventKey("test_event").get(0); - attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId); + attributes.put(BUCKETING_ATTRIBUTE, bucketingId); optimizelyClient.track("test_event", "userId", attributes); verify(bucketer).bucket(experiment, bucketingId); verifyZeroInteractions(logger); @@ -853,7 +855,7 @@ public void testGoodGetVariationBucketingId() { Experiment experiment = optimizelyClient.getProjectConfig().getExperimentKeyMapping().get("android_experiment_key"); String bucketingId = "1"; Map attributes = new HashMap<>(); - attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId); + attributes.put(BUCKETING_ATTRIBUTE, bucketingId); Variation v = optimizelyClient.getVariation("android_experiment_key", "userId", attributes); verify(bucketer).bucket(experiment, bucketingId); } diff --git a/build.gradle b/build.gradle index 1c83c1885..165b783f6 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ ext { build_tools_version = "27.0.0" min_sdk_version = 14 target_sdk_version = 26 - java_core_ver = "2.0.1" + java_core_ver = "2.1.1" android_logger_ver = "1.3.6" support_annotations_ver = "24.2.1" junit_ver = "4.12" diff --git a/test-app/src/androidTest/java/com/optimizely/ab/android/test_app/MainActivityEspressoTest.java b/test-app/src/androidTest/java/com/optimizely/ab/android/test_app/MainActivityEspressoTest.java index 93fcb32b8..f5e37b8e7 100644 --- a/test-app/src/androidTest/java/com/optimizely/ab/android/test_app/MainActivityEspressoTest.java +++ b/test-app/src/androidTest/java/com/optimizely/ab/android/test_app/MainActivityEspressoTest.java @@ -121,10 +121,10 @@ protected void before() throws Throwable { super.before(); dataFileServiceIntent = new Intent(context, DatafileService.class); - dataFileServiceIntent.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID).toJSONString()); + dataFileServiceIntent.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID, null).toJSONString()); eventIntentService = new Intent(context, EventIntentService.class); - eventIntentService.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID).toJSONString()); + eventIntentService.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID, null).toJSONString()); Context applicationContext = context.getApplicationContext(); ServiceScheduler.PendingIntentFactory pendingIntentFactory = new ServiceScheduler.PendingIntentFactory(applicationContext);