|
20 | 20 | import com.google.gson.Gson;
|
21 | 21 | import com.google.gson.GsonBuilder;
|
22 | 22 | import com.optimizely.ab.bucketing.Bucketer;
|
23 |
| -import com.optimizely.ab.bucketing.DecisionService; |
24 |
| -import com.optimizely.ab.bucketing.UserProfileService; |
25 | 23 | import com.optimizely.ab.config.Attribute;
|
26 | 24 | import com.optimizely.ab.config.EventType;
|
27 | 25 | import com.optimizely.ab.config.Experiment;
|
28 | 26 | import com.optimizely.ab.config.ProjectConfig;
|
29 | 27 | import com.optimizely.ab.config.Variation;
|
30 |
| -import com.optimizely.ab.error.ErrorHandler; |
31 | 28 | import com.optimizely.ab.event.LogEvent;
|
32 | 29 | import com.optimizely.ab.event.internal.payload.Decision;
|
33 | 30 | import com.optimizely.ab.event.internal.payload.EventBatch;
|
@@ -147,6 +144,7 @@ public void createImpressionEventPassingUserAgentAttribute() throws Exception {
|
147 | 144 | assertThat((double) eventBatch.getVisitors().get(0).getSnapshots().get(0).getEvents().get(0).getTimestamp(), closeTo((double) System.currentTimeMillis(), 1000.0));
|
148 | 145 | assertFalse(eventBatch.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0).getIsCampaignHoldback());
|
149 | 146 | assertThat(eventBatch.getAnonymizeIp(), is(validProjectConfig.getAnonymizeIP()));
|
| 147 | + assertTrue(eventBatch.getEnrichDecisions()); |
150 | 148 | assertThat(eventBatch.getProjectId(), is(validProjectConfig.getProjectId()));
|
151 | 149 | assertThat(eventBatch.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0), is(expectedDecision));
|
152 | 150 | assertThat(eventBatch.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0).getCampaignId(),
|
@@ -206,6 +204,7 @@ public void createImpressionEvent() throws Exception {
|
206 | 204 | assertThat((double) eventBatch.getVisitors().get(0).getSnapshots().get(0).getEvents().get(0).getTimestamp(), closeTo((double) System.currentTimeMillis(), 1000.0));
|
207 | 205 | assertFalse(eventBatch.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0).getIsCampaignHoldback());
|
208 | 206 | assertThat(eventBatch.getAnonymizeIp(), is(validProjectConfig.getAnonymizeIP()));
|
| 207 | + assertTrue(eventBatch.getEnrichDecisions()); |
209 | 208 | assertThat(eventBatch.getProjectId(), is(validProjectConfig.getProjectId()));
|
210 | 209 | assertThat(eventBatch.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0), is(expectedDecision));
|
211 | 210 | assertThat(eventBatch.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0).getCampaignId(),
|
@@ -521,6 +520,7 @@ public void createConversionEvent() throws Exception {
|
521 | 520 | assertTrue(conversion.getVisitors().get(0).getAttributes().containsAll(expectedUserFeatures));
|
522 | 521 | assertTrue(conversion.getVisitors().get(0).getSnapshots().get(0).getEvents().get(0).getTags().equals(eventTagMap));
|
523 | 522 | assertEquals(conversion.getAnonymizeIp(), validProjectConfig.getAnonymizeIP());
|
| 523 | + assertTrue(conversion.getEnrichDecisions()); |
524 | 524 | assertEquals(conversion.getClientName(), EventBatch.ClientEngine.JAVA_SDK.getClientEngineValue());
|
525 | 525 | assertEquals(conversion.getClientVersion(), BuildVersionInfo.VERSION);
|
526 | 526 | }
|
@@ -588,6 +588,7 @@ public void createConversionEventPassingUserAgentAttribute() throws Exception {
|
588 | 588 | assertTrue(conversion.getVisitors().get(0).getAttributes().containsAll(expectedUserFeatures));
|
589 | 589 | assertTrue(conversion.getVisitors().get(0).getSnapshots().get(0).getEvents().get(0).getTags().equals(eventTagMap));
|
590 | 590 | assertEquals(conversion.getAnonymizeIp(), validProjectConfig.getAnonymizeIP());
|
| 591 | + assertTrue(conversion.getEnrichDecisions()); |
591 | 592 | assertEquals(conversion.getClientName(), EventBatch.ClientEngine.JAVA_SDK.getClientEngineValue());
|
592 | 593 | assertEquals(conversion.getClientVersion(), BuildVersionInfo.VERSION);
|
593 | 594 | }
|
@@ -822,6 +823,7 @@ public void createImpressionEventWithBucketingId() throws Exception {
|
822 | 823 | assertThat((double) impression.getVisitors().get(0).getSnapshots().get(0).getEvents().get(0).getTimestamp(), closeTo((double) System.currentTimeMillis(), 1000.0));
|
823 | 824 | assertFalse(impression.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0).getIsCampaignHoldback());
|
824 | 825 | assertThat(impression.getAnonymizeIp(), is(projectConfig.getAnonymizeIP()));
|
| 826 | + assertTrue(impression.getEnrichDecisions()); |
825 | 827 | assertThat(impression.getProjectId(), is(projectConfig.getProjectId()));
|
826 | 828 | assertThat(impression.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0), is(expectedDecision));
|
827 | 829 | assertThat(impression.getVisitors().get(0).getSnapshots().get(0).getDecisions().get(0).getCampaignId(), is(activatedExperiment.getLayerId()));
|
@@ -900,6 +902,7 @@ public void createConversionEventWithBucketingId() throws Exception {
|
900 | 902 | assertEquals(conversion.getVisitors().get(0).getSnapshots().get(0).getEvents().get(0).getQuantity(), null);
|
901 | 903 | assertTrue(conversion.getVisitors().get(0).getSnapshots().get(0).getEvents().get(0).getTags().equals(eventTagMap));
|
902 | 904 | assertEquals(conversion.getAnonymizeIp(), validProjectConfig.getAnonymizeIP());
|
| 905 | + assertTrue(conversion.getEnrichDecisions()); |
903 | 906 | assertEquals(conversion.getClientName(), EventBatch.ClientEngine.JAVA_SDK.getClientEngineValue());
|
904 | 907 | assertEquals(conversion.getClientVersion(), BuildVersionInfo.VERSION);
|
905 | 908 | }
|
|
0 commit comments