Skip to content

Commit 098f47a

Browse files
committed
Fix test
1 parent 4bf0e2a commit 098f47a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core-api/src/main/java/com/optimizely/ab/notification/DecisionNotification.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public static class ExperimentDecisionNotificationBuilder {
103103
private String type;
104104
private String experimentKey;
105105
private String experimentId;
106+
private String variationId;
106107
private Variation variation;
107108
private String userId;
108109
private Map<String, ?> attributes;
@@ -138,6 +139,11 @@ public ExperimentDecisionNotificationBuilder withExperimentId(String experimentI
138139
return this;
139140
}
140141

142+
public ExperimentDecisionNotificationBuilder withVariationId(String variationId) {
143+
this.variationId = variationId;
144+
return this;
145+
}
146+
141147
public DecisionNotification build() {
142148
if (type == null) {
143149
throw new OptimizelyRuntimeException("type not set");
@@ -151,7 +157,7 @@ public DecisionNotification build() {
151157
decisionInfo.put(EXPERIMENT_KEY, experimentKey);
152158
decisionInfo.put(EXPERIMENT_ID, experimentId);
153159
decisionInfo.put(VARIATION_KEY, variation != null ? variation.getKey() : null);
154-
decisionInfo.put(VARIATION_ID, variation != null ? variation.getId() : null);
160+
decisionInfo.put(VARIATION_ID, variationId);
155161

156162
return new DecisionNotification(
157163
type,

0 commit comments

Comments
 (0)