forked from kuzzleio/kuzzle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MQTT.feature
131 lines (113 loc) · 4.77 KB
/
MQTT.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Feature: Test MQTT API
As a user
I want to create/update/delete/search a document and test bulk import
Using MQTT API
@usingMQTT
Scenario: Create a new document and get it
When I write the document
Then I should receive a document id
Then I'm able to get the document
@usingMQTT
Scenario: Update a document
When I write the document
Then I update the document with value "foo" in field "firstName"
Then my document has the value "foo" in field "firstName"
@usingMQTT
Scenario: Delete a document
When I write the document
Then I remove the document
Then I'm not able to get the document
@usingMQTT
Scenario: Search a document
When I write the document "documentGrace"
Then I find a document with "grace" in field "firstName"
@usingMQTT
Scenario: Bulk import
When I do a bulk import
Then I can retrieve actions from bulk import
@usingMQTT
Scenario: Global Bulk import
When I do a global bulk import
Then I can retrieve actions from bulk import
@usingMQTT
Scenario: Delete type
When I write the document
Then I remove the collection and schema
Then I'm not able to get the document
@usingMQTT
Scenario: Count document
When I write the document "documentGrace"
When I write the document "documentAda"
When I write the document "documentGrace"
When I write the document "documentAda"
Then I count 4 documents
And I count 2 documents with "NYC" in field "city"
@removeSchema @usingMQTT
Scenario: Change mapping
When I write the document "documentGrace"
Then I don't find a document with "Grace" in field "firstName"
Then I remove the collection and schema
Then I wait 2s
Then I change the schema
When I write the document "documentGrace"
Then I find a document with "Grace" in field "firstName"
@usingMQTT @unsubscribe
Scenario: Document creation notifications
Given A room subscription listening to "lastName" having value "Hopper"
When I write the document "documentGrace"
Then I should receive a "create" notification
And The notification should have a "_source" member
@usingMQTT @unsubscribe
Scenario: Document delete notifications
Given A room subscription listening to "lastName" having value "Hopper"
When I write the document "documentGrace"
Then I remove the document
Then I should receive a "delete" notification
And The notification should not have a "_source" member
@usingMQTT @unsubscribe
Scenario: Document update: new document notification
Given A room subscription listening to "lastName" having value "Hopper"
When I write the document "documentAda"
Then I update the document with value "Hopper" in field "lastName"
Then I should receive a "update" notification
And The notification should have a "_source" member
@usingMQTT @unsubscribe
Scenario: Document update: removed document notification
Given A room subscription listening to "lastName" having value "Hopper"
When I write the document "documentGrace"
Then I update the document with value "Foo" in field "lastName"
Then I should receive a "update" notification
And The notification should not have a "_source" member
@usingMQTT @unsubscribe
Scenario: Document creation notifications with not exists
Given A room subscription listening field "toto" doesn't exists
When I write the document "documentGrace"
Then I should receive a "create" notification
And The notification should have a "_source" member
@usingMQTT @unsubscribe
Scenario: Subscribe to a collection
Given A room subscription listening to the whole collection
When I write the document "documentGrace"
Then I should receive a "create" notification
And The notification should have a "_source" member
@usingMQTT @unsubscribe
Scenario: Delete a document with a query
Given A room subscription listening to "lastName" having value "Hopper"
When I write the document "documentGrace"
And I write the document "documentAda"
And I wait 1s
Then I remove documents with field "hobby" equals to value "computer"
Then I should receive a "delete" notification
And The notification should not have a "_source" member
@usingMQTT @unsubscribe
Scenario: Count how many subscription on a room
Given A room subscription listening to "lastName" having value "Hopper"
Given A room subscription listening to "lastName" having value "Hopper"
Then I can count "2" subscription
@usingMQTT @unsubscribe
Scenario: Subscription notifications
Given A room subscription listening to "lastName" having value "Hopper"
Given A room subscription listening to "lastName" having value "Hopper"
Then I should receive a "on" notification
Then I unsubscribe
And I should receive a "off" notification