Skip to content

Commit ed40a41

Browse files
authored
Upgrade to Java 2.1.1 which fixes feature impression sending for vari… (#205)
1 parent 3a9d8b4 commit ed40a41

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

android-sdk/src/androidTest/java/com/optimizely/ab/android/sdk/OptimizelyClientTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868

6969
@RunWith(Parameterized.class)
7070
public class OptimizelyClientTest {
71+
static String BUCKETING_ATTRIBUTE = "$opt_bucketing_id";
72+
7173
@Parameterized.Parameters
7274
public static Collection<Object[]> data() throws IOException {
7375
return Arrays.asList(new Object[][] {
@@ -311,7 +313,7 @@ public void testGoodActivationBucketingId() {
311313
final HashMap<String, String> attributes = new HashMap<>();
312314
String bucketingId = "1";
313315
Experiment experiment = optimizelyClient.getProjectConfig().getExperimentKeyMapping().get(FEATURE_ANDROID_EXPERIMENT_KEY);
314-
attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId);
316+
attributes.put(BUCKETING_ATTRIBUTE, bucketingId);
315317
Variation v = optimizelyClient.activate(FEATURE_ANDROID_EXPERIMENT_KEY, GENERIC_USER_ID, attributes);
316318
verify(bucketer).bucket( experiment, bucketingId);
317319
}
@@ -453,7 +455,7 @@ public void testGoodTrackBucketing() {
453455
Map<String,String> attributes = new HashMap<>();
454456
String bucketingId = "1";
455457
Experiment experiment = optimizelyClient.getProjectConfig().getExperimentsForEventKey("test_event").get(0);
456-
attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId);
458+
attributes.put(BUCKETING_ATTRIBUTE, bucketingId);
457459
optimizelyClient.track("test_event", "userId", attributes);
458460
verify(bucketer).bucket(experiment, bucketingId);
459461
verifyZeroInteractions(logger);
@@ -853,7 +855,7 @@ public void testGoodGetVariationBucketingId() {
853855
Experiment experiment = optimizelyClient.getProjectConfig().getExperimentKeyMapping().get("android_experiment_key");
854856
String bucketingId = "1";
855857
Map<String, String> attributes = new HashMap<>();
856-
attributes.put(DecisionService.BUCKETING_ATTRIBUTE, bucketingId);
858+
attributes.put(BUCKETING_ATTRIBUTE, bucketingId);
857859
Variation v = optimizelyClient.getVariation("android_experiment_key", "userId", attributes);
858860
verify(bucketer).bucket(experiment, bucketingId);
859861
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ext {
5353
build_tools_version = "27.0.0"
5454
min_sdk_version = 14
5555
target_sdk_version = 26
56-
java_core_ver = "2.0.1"
56+
java_core_ver = "2.1.1"
5757
android_logger_ver = "1.3.6"
5858
support_annotations_ver = "24.2.1"
5959
junit_ver = "4.12"

test-app/src/androidTest/java/com/optimizely/ab/android/test_app/MainActivityEspressoTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ protected void before() throws Throwable {
121121
super.before();
122122

123123
dataFileServiceIntent = new Intent(context, DatafileService.class);
124-
dataFileServiceIntent.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID).toJSONString());
124+
dataFileServiceIntent.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID, null).toJSONString());
125125

126126
eventIntentService = new Intent(context, EventIntentService.class);
127-
eventIntentService.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID).toJSONString());
127+
eventIntentService.putExtra(DatafileService.EXTRA_DATAFILE_CONFIG, new DatafileConfig(MyApplication.PROJECT_ID, null).toJSONString());
128128

129129
Context applicationContext = context.getApplicationContext();
130130
ServiceScheduler.PendingIntentFactory pendingIntentFactory = new ServiceScheduler.PendingIntentFactory(applicationContext);

0 commit comments

Comments
 (0)