Skip to content

Commit efa87e1

Browse files
committed
test: add test cases for schema validation
1 parent 7523019 commit efa87e1

File tree

6 files changed

+1081
-0
lines changed

6 files changed

+1081
-0
lines changed
Lines changed: 330 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,330 @@
1+
{
2+
"features": [{
3+
"key": "feature1",
4+
"name": "Feature1",
5+
"metrics": [{
6+
"id": 1,
7+
"type": "REVENUE_TRACKING",
8+
"identifier": "custom1",
9+
"mca": -1
10+
}],
11+
"rules": [{
12+
"variationId": 1,
13+
"type": "FLAG_ROLLOUT",
14+
"campaignId": 1,
15+
"ruleKey": "rolloutRule1"
16+
},
17+
{
18+
"variationId": 2,
19+
"type": "FLAG_ROLLOUT",
20+
"campaignId": 1,
21+
"ruleKey": "rolloutRule2"
22+
},
23+
{
24+
"campaignId": 2,
25+
"type": "FLAG_TESTING",
26+
"ruleKey": "testingRule1"
27+
},
28+
{
29+
"campaignId": 3,
30+
"type": "FLAG_TESTING",
31+
"ruleKey": "testingRule2"
32+
}
33+
],
34+
"type": "FEATURE_FLAG",
35+
"impactCampaign": {},
36+
"id": 1,
37+
"status": "ON"
38+
}],
39+
"version": 1,
40+
"accountId": 12345,
41+
"extraKey": "extraKey",
42+
"sdkKey": "000000000000_MASKED_000000000000",
43+
"campaigns": [{
44+
"key": "feature1_rolloutRule1",
45+
"name": "feature1_rolloutRule1",
46+
"id": 1,
47+
"segments": {},
48+
"isForcedVariationEnabled": false,
49+
"variations": [{
50+
"variables": [{
51+
"key": "int",
52+
"id": 1,
53+
"value": 10,
54+
"type": "integer"
55+
},
56+
{
57+
"key": "float",
58+
"id": 2,
59+
"value": 20.01,
60+
"type": "double"
61+
},
62+
{
63+
"key": "string",
64+
"id": 3,
65+
"value": "rollout1",
66+
"type": "string"
67+
},
68+
{
69+
"key": "boolean",
70+
"id": 4,
71+
"value": false,
72+
"type": "boolean"
73+
},
74+
{
75+
"key": "json",
76+
"id": 5,
77+
"value": {
78+
"campaign": "rollout1"
79+
},
80+
"type": "json"
81+
}
82+
],
83+
"id": 1,
84+
"segments": {
85+
"or": [{
86+
"custom_variable": {
87+
"price": "100"
88+
}
89+
}]
90+
},
91+
"weight": 100,
92+
"name": "Rollout-rule-1"
93+
},
94+
{
95+
"variables": [{
96+
"key": "int",
97+
"id": 1,
98+
"value": 11,
99+
"type": "integer"
100+
},
101+
{
102+
"key": "float",
103+
"id": 2,
104+
"value": 20.02,
105+
"type": "double"
106+
},
107+
{
108+
"key": "string",
109+
"id": 3,
110+
"value": "rollout1",
111+
"type": "string"
112+
},
113+
{
114+
"key": "boolean",
115+
"id": 4,
116+
"value": true,
117+
"type": "boolean"
118+
},
119+
{
120+
"key": "json",
121+
"id": 5,
122+
"value": {
123+
"campaign": "rollout2"
124+
},
125+
"type": "json"
126+
}
127+
],
128+
"id": 2,
129+
"segments": {
130+
"or": [{
131+
"custom_variable": {
132+
"price": "200"
133+
}
134+
}]
135+
},
136+
"weight": 100,
137+
"name": "Rollout-rule-2"
138+
}
139+
],
140+
"type": "FLAG_ROLLOUT",
141+
"status": "RUNNING"
142+
},
143+
{
144+
"key": "feature1_testingRule1",
145+
"name": "feature1_testingRule1",
146+
"id": 2,
147+
"segments": {
148+
"or": [{
149+
"custom_variable": {
150+
"price": "100"
151+
}
152+
}]
153+
},
154+
"isForcedVariationEnabled": false,
155+
"variations": [{
156+
"weight": 50,
157+
"id": 1,
158+
"variables": [{
159+
"key": "int",
160+
"id": 1,
161+
"value": 10,
162+
"type": "integer"
163+
},
164+
{
165+
"key": "float",
166+
"id": 2,
167+
"value": 20.01,
168+
"type": "double"
169+
},
170+
{
171+
"key": "string",
172+
"id": 3,
173+
"value": "testing1",
174+
"type": "string"
175+
},
176+
{
177+
"key": "boolean",
178+
"id": 4,
179+
"value": false,
180+
"type": "boolean"
181+
},
182+
{
183+
"key": "json",
184+
"id": 5,
185+
"value": {
186+
"campaign": "testing1"
187+
},
188+
"type": "json"
189+
}
190+
],
191+
"name": "Default"
192+
},
193+
{
194+
"weight": 50,
195+
"id": 2,
196+
"variables": [{
197+
"key": "int",
198+
"id": 1,
199+
"value": 11,
200+
"type": "integer"
201+
},
202+
{
203+
"key": "float",
204+
"id": 2,
205+
"value": 20.02,
206+
"type": "double"
207+
},
208+
{
209+
"key": "string",
210+
"id": 3,
211+
"value": "testing1_variation",
212+
"type": "string"
213+
},
214+
{
215+
"key": "boolean",
216+
"id": 4,
217+
"value": true,
218+
"type": "boolean"
219+
},
220+
{
221+
"key": "json",
222+
"id": 5,
223+
"value": {
224+
"campaign": "testing1_variation"
225+
},
226+
"type": "json"
227+
}
228+
],
229+
"name": "Variation-1"
230+
}
231+
],
232+
"percentTraffic": 100,
233+
"type": "FLAG_TESTING",
234+
"status": "RUNNING"
235+
},
236+
{
237+
"key": "feature1_testingRule2",
238+
"name": "feature1_testingRule2",
239+
"id": 3,
240+
"segments": {
241+
"or": [{
242+
"custom_variable": {
243+
"price": "200"
244+
}
245+
}]
246+
},
247+
"isForcedVariationEnabled": false,
248+
"variations": [{
249+
"weight": 50,
250+
"id": 1,
251+
"variables": [{
252+
"key": "int",
253+
"id": 1,
254+
"value": 10,
255+
"type": "integer"
256+
},
257+
{
258+
"key": "float",
259+
"id": 2,
260+
"value": 20.01,
261+
"type": "double"
262+
},
263+
{
264+
"key": "string",
265+
"id": 3,
266+
"value": "testin2",
267+
"type": "string"
268+
},
269+
{
270+
"key": "boolean",
271+
"id": 4,
272+
"value": false,
273+
"type": "boolean"
274+
},
275+
{
276+
"key": "json",
277+
"id": 5,
278+
"value": {
279+
"campaign": "testing2"
280+
},
281+
"type": "json"
282+
}
283+
],
284+
"name": "Default"
285+
},
286+
{
287+
"weight": 50,
288+
"id": 2,
289+
"variables": [{
290+
"key": "int",
291+
"id": 1,
292+
"value": 11,
293+
"type": "integer"
294+
},
295+
{
296+
"key": "float",
297+
"id": 2,
298+
"value": 20.02,
299+
"type": "double"
300+
},
301+
{
302+
"key": "string",
303+
"id": 3,
304+
"value": "testing2_variation",
305+
"type": "string"
306+
},
307+
{
308+
"key": "boolean",
309+
"id": 4,
310+
"value": true,
311+
"type": "boolean"
312+
},
313+
{
314+
"key": "json",
315+
"id": 5,
316+
"value": {
317+
"campaign": "testing2_variation"
318+
},
319+
"type": "json"
320+
}
321+
],
322+
"name": "Variation-1"
323+
}
324+
],
325+
"percentTraffic": 100,
326+
"type": "FLAG_TESTING",
327+
"status": "RUNNING"
328+
}
329+
]
330+
}

0 commit comments

Comments
 (0)