Debian Codegraph @

testdata/unified-test-format/valid-pass/expectedEventsForClient-eventType.json

raw
1 {
2 "description": "expectedEventsForClient-eventType",
3 "schemaVersion": "1.3",
4 "createEntities": [
5 {
6 "client": {
7 "id": "client0",
8 "useMultipleMongoses": true,
9 "observeEvents": [
10 "commandStartedEvent",
11 "connectionReadyEvent"
12 ]
13 }
14 },
15 {
16 "database": {
17 "id": "database0",
18 "client": "client0",
19 "databaseName": "database0Name"
20 }
21 },
22 {
23 "collection": {
24 "id": "collection0",
25 "database": "database0",
26 "collectionName": "coll0"
27 }
28 }
29 ],
30 "initialData": [
31 {
32 "collectionName": "coll0",
33 "databaseName": "database0Name",
34 "documents": []
35 }
36 ],
37 "tests": [
38 {
39 "description": "eventType can be set to command and cmap",
40 "operations": [
41 {
42 "name": "insertOne",
43 "object": "collection0",
44 "arguments": {
45 "document": {
46 "_id": 1
47 }
48 }
49 }
50 ],
51 "expectEvents": [
52 {
53 "client": "client0",
54 "eventType": "command",
55 "events": [
56 {
57 "commandStartedEvent": {
58 "command": {
59 "insert": "coll0",
60 "documents": [
61 {
62 "_id": 1
63 }
64 ]
65 },
66 "commandName": "insert"
67 }
68 }
69 ]
70 },
71 {
72 "client": "client0",
73 "eventType": "cmap",
74 "events": [
75 {
76 "connectionReadyEvent": {}
77 }
78 ]
79 }
80 ]
81 },
82 {
83 "description": "eventType defaults to command if unset",
84 "operations": [
85 {
86 "name": "insertOne",
87 "object": "collection0",
88 "arguments": {
89 "document": {
90 "_id": 1
91 }
92 }
93 }
94 ],
95 "expectEvents": [
96 {
97 "client": "client0",
98 "events": [
99 {
100 "commandStartedEvent": {
101 "command": {
102 "insert": "coll0",
103 "documents": [
104 {
105 "_id": 1
106 }
107 ]
108 },
109 "commandName": "insert"
110 }
111 }
112 ]
113 },
114 {
115 "client": "client0",
116 "eventType": "cmap",
117 "events": [
118 {
119 "connectionReadyEvent": {}
120 }
121 ]
122 }
123 ]
124 }
125 ]
126 }