Skip to content

Commit 1abfbb7

Browse files
authored
renamed custom dimensions to custom attributes (#210)
1 parent 7347f06 commit 1abfbb7

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

core-api/src/test/java/com/optimizely/ab/config/ProjectConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void verifyGetExperimentsForInvalidEvent() throws Exception {
106106
@Test
107107
public void verifyGetAudienceConditionsFromValidId() throws Exception {
108108
List<Condition> userAttributes = new ArrayList<Condition>();
109-
userAttributes.add(new UserAttribute("browser_type", "custom_dimension", "firefox"));
109+
userAttributes.add(new UserAttribute("browser_type", "custom_attribute", "firefox"));
110110

111111
OrCondition orInner = new OrCondition(userAttributes);
112112

core-api/src/test/java/com/optimizely/ab/config/ProjectConfigTestUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static ProjectConfig generateValidProjectConfigV2() {
8888
new EventType("100", "no_running_experiments", singletonList("118")));
8989

9090
List<Condition> userAttributes = new ArrayList<Condition>();
91-
userAttributes.add(new UserAttribute("browser_type", "custom_dimension", "firefox"));
91+
userAttributes.add(new UserAttribute("browser_type", "custom_attribute", "firefox"));
9292

9393
OrCondition orInner = new OrCondition(userAttributes);
9494

@@ -245,7 +245,7 @@ private static ProjectConfig generateValidProjectConfigV3() {
245245
new EventType("100", "no_running_experiments", singletonList("118")));
246246

247247
List<Condition> userAttributes = new ArrayList<Condition>();
248-
userAttributes.add(new UserAttribute("browser_type", "custom_dimension", "firefox"));
248+
userAttributes.add(new UserAttribute("browser_type", "custom_attribute", "firefox"));
249249

250250
OrCondition orInner = new OrCondition(userAttributes);
251251

core-api/src/test/java/com/optimizely/ab/config/ValidProjectConfigV4.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class ValidProjectConfigV4 {
6262
private static final Attribute ATTRIBUTE_DOUBLE = new Attribute(ATTRIBUTE_DOUBLE_ID, ATTRIBUTE_DOUBLE_KEY);
6363

6464
// audiences
65-
private static final String CUSTOM_DIMENSION_TYPE = "custom_dimension";
65+
private static final String CUSTOM_ATTRIBUTE_TYPE = "custom_attribute";
6666
private static final String AUDIENCE_GRYFFINDOR_ID = "3468206642";
6767
private static final String AUDIENCE_GRYFFINDOR_KEY = "Gryffindors";
6868
public static final String AUDIENCE_GRYFFINDOR_VALUE = "Gryffindor";
@@ -72,7 +72,7 @@ public class ValidProjectConfigV4 {
7272
new AndCondition(Collections.<Condition>singletonList(
7373
new OrCondition(Collections.<Condition>singletonList(
7474
new OrCondition(Collections.singletonList((Condition) new UserAttribute(ATTRIBUTE_HOUSE_KEY,
75-
CUSTOM_DIMENSION_TYPE,
75+
CUSTOM_ATTRIBUTE_TYPE,
7676
AUDIENCE_GRYFFINDOR_VALUE)))))))
7777
);
7878
private static final String AUDIENCE_SLYTHERIN_ID = "3988293898";
@@ -84,7 +84,7 @@ public class ValidProjectConfigV4 {
8484
new AndCondition(Collections.<Condition>singletonList(
8585
new OrCondition(Collections.<Condition>singletonList(
8686
new OrCondition(Collections.singletonList((Condition) new UserAttribute(ATTRIBUTE_HOUSE_KEY,
87-
CUSTOM_DIMENSION_TYPE,
87+
CUSTOM_ATTRIBUTE_TYPE,
8888
AUDIENCE_SLYTHERIN_VALUE)))))))
8989
);
9090

@@ -97,20 +97,20 @@ public class ValidProjectConfigV4 {
9797
new AndCondition(Collections.<Condition>singletonList(
9898
new OrCondition(Collections.<Condition>singletonList(
9999
new OrCondition(Collections.singletonList((Condition) new UserAttribute(ATTRIBUTE_NATIONALITY_KEY,
100-
CUSTOM_DIMENSION_TYPE,
100+
CUSTOM_ATTRIBUTE_TYPE,
101101
AUDIENCE_ENGLISH_CITIZENS_VALUE)))))))
102102
);
103103
private static final String AUDIENCE_WITH_MISSING_VALUE_ID = "2196265320";
104104
private static final String AUDIENCE_WITH_MISSING_VALUE_KEY = "audience_with_missing_value";
105105
public static final String AUDIENCE_WITH_MISSING_VALUE_VALUE = "English";
106106
private static final UserAttribute ATTRIBUTE_WITH_VALUE = new UserAttribute(
107107
ATTRIBUTE_NATIONALITY_KEY,
108-
CUSTOM_DIMENSION_TYPE,
108+
CUSTOM_ATTRIBUTE_TYPE,
109109
AUDIENCE_WITH_MISSING_VALUE_VALUE
110110
);
111111
private static final UserAttribute ATTRIBUTE_WITHOUT_VALUE = new UserAttribute(
112112
ATTRIBUTE_NATIONALITY_KEY,
113-
CUSTOM_DIMENSION_TYPE,
113+
CUSTOM_ATTRIBUTE_TYPE,
114114
null
115115
);
116116
private static final Audience AUDIENCE_WITH_MISSING_VALUE = new Audience(

core-api/src/test/java/com/optimizely/ab/config/audience/AudienceConditionEvaluationTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void initialize() {
6363
*/
6464
@Test
6565
public void userAttributeEvaluateTrue() throws Exception {
66-
UserAttribute testInstance = new UserAttribute("browser_type", "custom_dimension", "chrome");
66+
UserAttribute testInstance = new UserAttribute("browser_type", "custom_attribute", "chrome");
6767
assertTrue(testInstance.evaluate(testUserAttributes));
6868
}
6969

@@ -73,10 +73,10 @@ public void userAttributeEvaluateTrue() throws Exception {
7373
*/
7474
@Test
7575
public void typedUserAttributeEvaluateTrue() throws Exception {
76-
UserAttribute testInstance = new UserAttribute("meta_data", "custom_dimension", testUserAttributes);
77-
UserAttribute testInstance2 = new UserAttribute("is_firefox", "custom_dimension", true);
78-
UserAttribute testInstance3 = new UserAttribute("num_counts", "custom_dimension", 3.55);
79-
UserAttribute testInstance4 = new UserAttribute("num_size", "custom_dimension", 3);
76+
UserAttribute testInstance = new UserAttribute("meta_data", "custom_attribute", testUserAttributes);
77+
UserAttribute testInstance2 = new UserAttribute("is_firefox", "custom_attribute", true);
78+
UserAttribute testInstance3 = new UserAttribute("num_counts", "custom_attribute", 3.55);
79+
UserAttribute testInstance4 = new UserAttribute("num_size", "custom_attribute", 3);
8080

8181
assertTrue(testInstance.evaluate(testTypedUserAttributes));
8282
assertTrue(testInstance2.evaluate(testTypedUserAttributes));
@@ -89,7 +89,7 @@ public void typedUserAttributeEvaluateTrue() throws Exception {
8989
*/
9090
@Test
9191
public void userAttributeEvaluateFalse() throws Exception {
92-
UserAttribute testInstance = new UserAttribute("browser_type", "custom_dimension", "firefox");
92+
UserAttribute testInstance = new UserAttribute("browser_type", "custom_attribute", "firefox");
9393
assertFalse(testInstance.evaluate(testUserAttributes));
9494
}
9595

@@ -98,7 +98,7 @@ public void userAttributeEvaluateFalse() throws Exception {
9898
*/
9999
@Test
100100
public void userAttributeUnknownAttribute() throws Exception {
101-
UserAttribute testInstance = new UserAttribute("unknown_dim", "custom_dimension", "unknown");
101+
UserAttribute testInstance = new UserAttribute("unknown_dim", "custom_attribute", "unknown");
102102
assertFalse(testInstance.evaluate(testUserAttributes));
103103
}
104104

core-api/src/test/resources/config/valid-project-config-v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
{
187187
"id": "100",
188188
"name": "not_firefox_users",
189-
"conditions": "[\"and\", [\"or\", [\"not\", [\"or\", {\"name\": \"browser_type\", \"type\": \"custom_dimension\", \"value\":\"firefox\"}]]]]"
189+
"conditions": "[\"and\", [\"or\", [\"not\", [\"or\", {\"name\": \"browser_type\", \"type\": \"custom_attribute\", \"value\":\"firefox\"}]]]]"
190190
}
191191
],
192192
"attributes": [

core-api/src/test/resources/config/valid-project-config-v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
{
202202
"id": "100",
203203
"name": "not_firefox_users",
204-
"conditions": "[\"and\", [\"or\", [\"not\", [\"or\", {\"name\": \"browser_type\", \"type\": \"custom_dimension\", \"value\":\"firefox\"}]]]]"
204+
"conditions": "[\"and\", [\"or\", [\"not\", [\"or\", {\"name\": \"browser_type\", \"type\": \"custom_attribute\", \"value\":\"firefox\"}]]]]"
205205
}
206206
],
207207
"attributes": [

core-api/src/test/resources/config/valid-project-config-v4.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
{
1010
"id": "3468206642",
1111
"name": "Gryffindors",
12-
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"house\", \"type\": \"custom_dimension\", \"value\":\"Gryffindor\"}]]]"
12+
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"house\", \"type\": \"custom_attribute\", \"value\":\"Gryffindor\"}]]]"
1313
},
1414
{
1515
"id": "3988293898",
1616
"name": "Slytherins",
17-
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"house\", \"type\": \"custom_dimension\", \"value\":\"Slytherin\"}]]]"
17+
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"house\", \"type\": \"custom_attribute\", \"value\":\"Slytherin\"}]]]"
1818
},
1919
{
2020
"id": "4194404272",
2121
"name": "english_citizens",
22-
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"nationality\", \"type\": \"custom_dimension\", \"value\":\"English\"}]]]"
22+
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"nationality\", \"type\": \"custom_attribute\", \"value\":\"English\"}]]]"
2323
},
2424
{
2525
"id": "2196265320",
2626
"name": "audience_with_missing_value",
27-
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"nationality\", \"type\": \"custom_dimension\", \"value\": \"English\"}, {\"name\": \"nationality\", \"type\": \"custom_dimension\"}]]]"
27+
"conditions": "[\"and\", [\"or\", [\"or\", {\"name\": \"nationality\", \"type\": \"custom_attribute\", \"value\": \"English\"}, {\"name\": \"nationality\", \"type\": \"custom_attribute\"}]]]"
2828
}
2929
],
3030
"attributes": [

0 commit comments

Comments
 (0)