Skip to content

Commit e3cc3d5

Browse files
committed
add comp rule test
1 parent 3d93cf1 commit e3cc3d5

File tree

1 file changed

+91
-11
lines changed

1 file changed

+91
-11
lines changed

tests/CTS/requests/composition/putCompositionRule.json

Lines changed: 91 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@
7878
}
7979
},
8080
{
81-
"skipLanguages": [
82-
"kotlin"
83-
],
81+
"skipLanguages": ["kotlin"],
8482
"parameters": {
8583
"compositionID": "compositionID",
8684
"objectID": "rule-with-metadata",
@@ -197,10 +195,7 @@
197195
"compositionRule": {
198196
"objectID": "rule-with-exernal-source",
199197
"description": "my description",
200-
"tags": [
201-
"tag1",
202-
"tag2"
203-
],
198+
"tags": ["tag1", "tag2"],
204199
"enabled": true,
205200
"validity": [
206201
{
@@ -258,10 +253,7 @@
258253
"body": {
259254
"objectID": "rule-with-exernal-source",
260255
"description": "my description",
261-
"tags": [
262-
"tag1",
263-
"tag2"
264-
],
256+
"tags": ["tag1", "tag2"],
265257
"enabled": true,
266258
"validity": [
267259
{
@@ -313,5 +305,93 @@
313305
}
314306
}
315307
}
308+
},
309+
{
310+
"parameters": {
311+
"compositionID": "compositionID",
312+
"objectID": "rule-with-deduplication",
313+
"compositionRule": {
314+
"objectID": "rule-with-deduplication",
315+
"description": "my description",
316+
"enabled": true,
317+
"conditions": [
318+
{
319+
"anchoring": "contains",
320+
"pattern": "harry"
321+
}
322+
],
323+
"consequence": {
324+
"behavior": {
325+
"injection": {
326+
"main": {
327+
"source": {
328+
"search": {
329+
"index": "my-index"
330+
}
331+
}
332+
},
333+
"injectedItems": [
334+
{
335+
"key": "injectedItem",
336+
"source": {
337+
"search": {
338+
"index": "my-index"
339+
}
340+
},
341+
"position": 0,
342+
"length": 3
343+
}
344+
],
345+
"deduplication": {
346+
"positioning": "highestInjected"
347+
}
348+
}
349+
}
350+
}
351+
}
352+
},
353+
"request": {
354+
"path": "/1/compositions/compositionID/rules/rule-with-deduplication",
355+
"method": "PUT",
356+
"body": {
357+
"objectID": "rule-with-deduplication",
358+
"description": "my description",
359+
"enabled": true,
360+
"conditions": [
361+
{
362+
"anchoring": "contains",
363+
"pattern": "harry"
364+
}
365+
],
366+
"consequence": {
367+
"behavior": {
368+
"injection": {
369+
"main": {
370+
"source": {
371+
"search": {
372+
"index": "my-index"
373+
}
374+
}
375+
},
376+
"injectedItems": [
377+
{
378+
"key": "injectedItem",
379+
"source": {
380+
"search": {
381+
"index": "my-index"
382+
}
383+
},
384+
"position": 0,
385+
"length": 3
386+
}
387+
],
388+
"deduplication": {
389+
"positioning": "highestInjected"
390+
}
391+
}
392+
}
393+
}
394+
}
395+
}
316396
}
317397
]

0 commit comments

Comments
 (0)