Skip to content

Commit 4127a22

Browse files
jyeminstIncMale
andauthored
Convert legacy write concern operation tests to unified format (#1347)
JAVA-5355 Co-authored-by: Valentin Kovalenko <[email protected]>
1 parent 5180661 commit 4127a22

File tree

18 files changed

+1313
-2120
lines changed

18 files changed

+1313
-2120
lines changed

driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-2.6.json

Lines changed: 636 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
{
2+
"description": "default-write-concern-3.2",
3+
"schemaVersion": "1.0",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "3.2"
7+
}
8+
],
9+
"createEntities": [
10+
{
11+
"client": {
12+
"id": "client0",
13+
"observeEvents": [
14+
"commandStartedEvent"
15+
]
16+
}
17+
},
18+
{
19+
"database": {
20+
"id": "database0",
21+
"client": "client0",
22+
"databaseName": "default-write-concern-tests",
23+
"databaseOptions": {
24+
"writeConcern": {}
25+
}
26+
}
27+
},
28+
{
29+
"collection": {
30+
"id": "collection0",
31+
"database": "database0",
32+
"collectionName": "coll",
33+
"collectionOptions": {
34+
"writeConcern": {}
35+
}
36+
}
37+
}
38+
],
39+
"initialData": [
40+
{
41+
"collectionName": "coll",
42+
"databaseName": "default-write-concern-tests",
43+
"documents": [
44+
{
45+
"_id": 1,
46+
"x": 11
47+
},
48+
{
49+
"_id": 2,
50+
"x": 22
51+
}
52+
]
53+
}
54+
],
55+
"tests": [
56+
{
57+
"description": "findAndModify operations omit default write concern",
58+
"operations": [
59+
{
60+
"name": "findOneAndUpdate",
61+
"object": "collection0",
62+
"arguments": {
63+
"filter": {
64+
"_id": 1
65+
},
66+
"update": {
67+
"$set": {
68+
"x": 1
69+
}
70+
}
71+
}
72+
},
73+
{
74+
"name": "findOneAndReplace",
75+
"object": "collection0",
76+
"arguments": {
77+
"filter": {
78+
"_id": 2
79+
},
80+
"replacement": {
81+
"x": 2
82+
}
83+
}
84+
},
85+
{
86+
"name": "findOneAndDelete",
87+
"object": "collection0",
88+
"arguments": {
89+
"filter": {
90+
"_id": 2
91+
}
92+
}
93+
}
94+
],
95+
"expectEvents": [
96+
{
97+
"client": "client0",
98+
"events": [
99+
{
100+
"commandStartedEvent": {
101+
"command": {
102+
"findAndModify": "coll",
103+
"query": {
104+
"_id": 1
105+
},
106+
"update": {
107+
"$set": {
108+
"x": 1
109+
}
110+
},
111+
"writeConcern": {
112+
"$$exists": false
113+
}
114+
}
115+
}
116+
},
117+
{
118+
"commandStartedEvent": {
119+
"command": {
120+
"findAndModify": "coll",
121+
"query": {
122+
"_id": 2
123+
},
124+
"update": {
125+
"x": 2
126+
},
127+
"writeConcern": {
128+
"$$exists": false
129+
}
130+
}
131+
}
132+
},
133+
{
134+
"commandStartedEvent": {
135+
"command": {
136+
"findAndModify": "coll",
137+
"query": {
138+
"_id": 2
139+
},
140+
"remove": true,
141+
"writeConcern": {
142+
"$$exists": false
143+
}
144+
}
145+
}
146+
}
147+
]
148+
}
149+
],
150+
"outcome": [
151+
{
152+
"collectionName": "coll",
153+
"databaseName": "default-write-concern-tests",
154+
"documents": [
155+
{
156+
"_id": 1,
157+
"x": 1
158+
}
159+
]
160+
}
161+
]
162+
}
163+
]
164+
}

0 commit comments

Comments
 (0)