Skip to content

Commit 2b68ece

Browse files
authored
Update Atlas search spec tests (#1315)
JAVA-5273 JAVA-5238
1 parent 2260ab5 commit 2b68ece

File tree

6 files changed

+272
-10
lines changed

6 files changed

+272
-10
lines changed

driver-core/src/test/resources/unified-test-format/index-management/createSearchIndex.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
}
5555
},
5656
"expectError": {
57-
"isError": true
57+
"isError": true,
58+
"errorContains": "Atlas"
5859
}
5960
}
6061
],
@@ -100,7 +101,8 @@
100101
}
101102
},
102103
"expectError": {
103-
"isError": true
104+
"isError": true,
105+
"errorContains": "Atlas"
104106
}
105107
}
106108
],

driver-core/src/test/resources/unified-test-format/index-management/createSearchIndexes.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"models": []
4949
},
5050
"expectError": {
51-
"isError": true
51+
"isError": true,
52+
"errorContains": "Atlas"
5253
}
5354
}
5455
],
@@ -87,7 +88,8 @@
8788
]
8889
},
8990
"expectError": {
90-
"isError": true
91+
"isError": true,
92+
"errorContains": "Atlas"
9193
}
9294
}
9395
],
@@ -135,7 +137,8 @@
135137
]
136138
},
137139
"expectError": {
138-
"isError": true
140+
"isError": true,
141+
"errorContains": "Atlas"
139142
}
140143
}
141144
],

driver-core/src/test/resources/unified-test-format/index-management/dropSearchIndex.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"name": "test index"
4949
},
5050
"expectError": {
51-
"isError": true
51+
"isError": true,
52+
"errorContains": "Atlas"
5253
}
5354
}
5455
],

driver-core/src/test/resources/unified-test-format/index-management/listSearchIndexes.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"name": "listSearchIndexes",
4646
"object": "collection0",
4747
"expectError": {
48-
"isError": true
48+
"isError": true,
49+
"errorContains": "Atlas"
4950
}
5051
}
5152
],
@@ -79,7 +80,8 @@
7980
"name": "test index"
8081
},
8182
"expectError": {
82-
"isError": true
83+
"isError": true,
84+
"errorContains": "Atlas"
8385
}
8486
}
8587
],
@@ -119,7 +121,8 @@
119121
}
120122
},
121123
"expectError": {
122-
"isError": true
124+
"isError": true,
125+
"errorContains": "Atlas"
123126
}
124127
}
125128
],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
{
2+
"description": "search index operations ignore read and write concern",
3+
"schemaVersion": "1.4",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0",
8+
"useMultipleMongoses": false,
9+
"uriOptions": {
10+
"readConcernLevel": "local",
11+
"w": 1
12+
},
13+
"observeEvents": [
14+
"commandStartedEvent"
15+
]
16+
}
17+
},
18+
{
19+
"database": {
20+
"id": "database0",
21+
"client": "client0",
22+
"databaseName": "database0"
23+
}
24+
},
25+
{
26+
"collection": {
27+
"id": "collection0",
28+
"database": "database0",
29+
"collectionName": "collection0"
30+
}
31+
}
32+
],
33+
"runOnRequirements": [
34+
{
35+
"minServerVersion": "7.0.0",
36+
"topologies": [
37+
"replicaset",
38+
"load-balanced",
39+
"sharded"
40+
],
41+
"serverless": "forbid"
42+
}
43+
],
44+
"tests": [
45+
{
46+
"description": "createSearchIndex ignores read and write concern",
47+
"operations": [
48+
{
49+
"name": "createSearchIndex",
50+
"object": "collection0",
51+
"arguments": {
52+
"model": {
53+
"definition": {
54+
"mappings": {
55+
"dynamic": true
56+
}
57+
}
58+
}
59+
},
60+
"expectError": {
61+
"isError": true,
62+
"errorContains": "Atlas"
63+
}
64+
}
65+
],
66+
"expectEvents": [
67+
{
68+
"client": "client0",
69+
"events": [
70+
{
71+
"commandStartedEvent": {
72+
"command": {
73+
"createSearchIndexes": "collection0",
74+
"indexes": [
75+
{
76+
"definition": {
77+
"mappings": {
78+
"dynamic": true
79+
}
80+
}
81+
}
82+
],
83+
"$db": "database0",
84+
"writeConcern": {
85+
"$$exists": false
86+
},
87+
"readConcern": {
88+
"$$exists": false
89+
}
90+
}
91+
}
92+
}
93+
]
94+
}
95+
]
96+
},
97+
{
98+
"description": "createSearchIndexes ignores read and write concern",
99+
"operations": [
100+
{
101+
"name": "createSearchIndexes",
102+
"object": "collection0",
103+
"arguments": {
104+
"models": []
105+
},
106+
"expectError": {
107+
"isError": true,
108+
"errorContains": "Atlas"
109+
}
110+
}
111+
],
112+
"expectEvents": [
113+
{
114+
"client": "client0",
115+
"events": [
116+
{
117+
"commandStartedEvent": {
118+
"command": {
119+
"createSearchIndexes": "collection0",
120+
"indexes": [],
121+
"$db": "database0",
122+
"writeConcern": {
123+
"$$exists": false
124+
},
125+
"readConcern": {
126+
"$$exists": false
127+
}
128+
}
129+
}
130+
}
131+
]
132+
}
133+
]
134+
},
135+
{
136+
"description": "dropSearchIndex ignores read and write concern",
137+
"operations": [
138+
{
139+
"name": "dropSearchIndex",
140+
"object": "collection0",
141+
"arguments": {
142+
"name": "test index"
143+
},
144+
"expectError": {
145+
"isError": true,
146+
"errorContains": "Atlas"
147+
}
148+
}
149+
],
150+
"expectEvents": [
151+
{
152+
"client": "client0",
153+
"events": [
154+
{
155+
"commandStartedEvent": {
156+
"command": {
157+
"dropSearchIndex": "collection0",
158+
"name": "test index",
159+
"$db": "database0",
160+
"writeConcern": {
161+
"$$exists": false
162+
},
163+
"readConcern": {
164+
"$$exists": false
165+
}
166+
}
167+
}
168+
}
169+
]
170+
}
171+
]
172+
},
173+
{
174+
"description": "listSearchIndexes ignores read and write concern",
175+
"operations": [
176+
{
177+
"name": "listSearchIndexes",
178+
"object": "collection0",
179+
"expectError": {
180+
"isError": true,
181+
"errorContains": "Atlas"
182+
}
183+
}
184+
],
185+
"expectEvents": [
186+
{
187+
"client": "client0",
188+
"events": [
189+
{
190+
"commandStartedEvent": {
191+
"command": {
192+
"aggregate": "collection0",
193+
"pipeline": [
194+
{
195+
"$listSearchIndexes": {}
196+
}
197+
],
198+
"writeConcern": {
199+
"$$exists": false
200+
},
201+
"readConcern": {
202+
"$$exists": false
203+
}
204+
}
205+
}
206+
}
207+
]
208+
}
209+
]
210+
},
211+
{
212+
"description": "updateSearchIndex ignores the read and write concern",
213+
"operations": [
214+
{
215+
"name": "updateSearchIndex",
216+
"object": "collection0",
217+
"arguments": {
218+
"name": "test index",
219+
"definition": {}
220+
},
221+
"expectError": {
222+
"isError": true,
223+
"errorContains": "Atlas"
224+
}
225+
}
226+
],
227+
"expectEvents": [
228+
{
229+
"client": "client0",
230+
"events": [
231+
{
232+
"commandStartedEvent": {
233+
"command": {
234+
"updateSearchIndex": "collection0",
235+
"name": "test index",
236+
"definition": {},
237+
"$db": "database0",
238+
"writeConcern": {
239+
"$$exists": false
240+
},
241+
"readConcern": {
242+
"$$exists": false
243+
}
244+
}
245+
}
246+
}
247+
]
248+
}
249+
]
250+
}
251+
]
252+
}

driver-core/src/test/resources/unified-test-format/index-management/updateSearchIndex.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"definition": {}
5050
},
5151
"expectError": {
52-
"isError": true
52+
"isError": true,
53+
"errorContains": "Atlas"
5354
}
5455
}
5556
],

0 commit comments

Comments
 (0)