Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@

@RunWith(Parameterized.class)
public class OptimizelyClientTest {
static String BUCKETING_ATTRIBUTE = "$opt_bucketing_id";

@Parameterized.Parameters
public static Collection<Object[]> data() throws IOException {
return Arrays.asList(new Object[][] {
Expand Down Expand Up @@ -311,7 +313,7 @@ public void testGoodActivationBucketingId() {
final HashMap<String, String> 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);
}
Expand Down Expand Up @@ -453,7 +455,7 @@ public void testGoodTrackBucketing() {
Map<String,String> 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);
Expand Down Expand Up @@ -853,7 +855,7 @@ public void testGoodGetVariationBucketingId() {
Experiment experiment = optimizelyClient.getProjectConfig().getExperimentKeyMapping().get("android_experiment_key");
String bucketingId = "1";
Map<String, String> 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);
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down