iotagent-node-lib 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +0 -1
- package/Changelog +12 -0
- package/config.js +3 -1
- package/doc/admin.md +39 -5
- package/doc/api.md +67 -6
- package/doc/requirements.txt +1 -1
- package/lib/commonConfig.js +21 -2
- package/lib/model/Command.js +2 -2
- package/lib/model/Device.js +7 -3
- package/lib/model/Group.js +5 -3
- package/lib/model/dbConn.js +53 -112
- package/lib/services/commands/commandRegistryMongoDB.js +115 -75
- package/lib/services/common/iotManagerService.js +3 -1
- package/lib/services/devices/deviceRegistryMemory.js +36 -0
- package/lib/services/devices/deviceRegistryMongoDB.js +160 -87
- package/lib/services/devices/deviceService.js +33 -3
- package/lib/services/devices/devices-NGSI-v2.js +6 -1
- package/lib/services/groups/groupRegistryMongoDB.js +120 -83
- package/lib/services/ngsi/entities-NGSI-v2.js +14 -1
- package/lib/services/ngsi/ngsiService.js +32 -1
- package/lib/services/northBound/deviceProvisioningServer.js +12 -3
- package/lib/templates/updateDevice.json +12 -0
- package/lib/templates/updateDeviceLax.json +12 -0
- package/package.json +4 -4
- package/test/functional/config-test.js +3 -2
- package/test/functional/testUtils.js +2 -2
- package/test/unit/examples/groupProvisioningRequests/provisionFullGroup.json +1 -0
- package/test/unit/general/config-multi-core-test.js +1 -2
- package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +5 -4
- package/test/unit/general/deviceService-test.js +6 -5
- package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +6 -5
- package/test/unit/mongodb/mongodb-connectionoptions-test.js +7 -39
- package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1 -2
- package/test/unit/ngsi-ld/general/config-jsonld-contexts-test.js +1 -2
- package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +8 -5
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +42 -41
- package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +11 -10
- package/test/unit/ngsiv2/general/deviceService-test.js +6 -5
- package/test/unit/ngsiv2/general/https-support-test.js +1 -1
- package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +4 -3
- package/test/unit/ngsiv2/lazyAndCommands/command-test.js +6 -5
- package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +17 -16
- package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +10 -18
- package/test/unit/ngsiv2/ngsiService/active-devices-test.js +21 -20
- package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +8 -7
- package/test/unit/ngsiv2/plugins/alias-plugin_test.js +12 -11
- package/test/unit/ngsiv2/plugins/custom-plugin_test.js +3 -2
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +28 -27
- package/test/unit/ngsiv2/provisioning/device-group-api-test.js +6 -4
- package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +12 -11
- package/test/unit/ngsiv2/provisioning/device-provisioning-configGroup-api_test.js +11 -10
- package/test/unit/ngsiv2/provisioning/device-registration_test.js +5 -4
- package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +6 -5
- package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +1 -1
- package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +5 -4
- package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +8 -7
|
@@ -85,7 +85,8 @@ const iotAgentConfig = {
|
|
|
85
85
|
service: 'smartgondor',
|
|
86
86
|
subservice: 'gardens',
|
|
87
87
|
providerUrl: 'http://smartgondor.com',
|
|
88
|
-
deviceRegistrationDuration: 'P1M'
|
|
88
|
+
deviceRegistrationDuration: 'P1M',
|
|
89
|
+
useCBflowControl: true
|
|
89
90
|
};
|
|
90
91
|
|
|
91
92
|
describe('NGSI-v2 - Secured access to the Context Broker with Keystone', function () {
|
|
@@ -128,7 +129,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with Keystone', functio
|
|
|
128
129
|
.matchHeader('fiware-service', 'smartgondor')
|
|
129
130
|
.matchHeader('fiware-servicepath', 'electricity')
|
|
130
131
|
.matchHeader('X-Auth-Token', '12345679ABCDEF')
|
|
131
|
-
.post('/v2/entities?options=upsert')
|
|
132
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
132
133
|
.reply(204);
|
|
133
134
|
iotAgentLib.activate(iotAgentConfig, done);
|
|
134
135
|
});
|
|
@@ -165,7 +166,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with Keystone', functio
|
|
|
165
166
|
.matchHeader('fiware-service', 'smartgondor')
|
|
166
167
|
.matchHeader('fiware-servicepath', 'electricity')
|
|
167
168
|
.matchHeader('X-Auth-Token', '12345679ABCDEF')
|
|
168
|
-
.post('/v2/entities?options=upsert')
|
|
169
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
169
170
|
.reply(403, { name: 'ACCESS_FORBIDDEN' });
|
|
170
171
|
|
|
171
172
|
iotAgentLib.activate(iotAgentConfig, done);
|
|
@@ -197,7 +198,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with Keystone', functio
|
|
|
197
198
|
.matchHeader('fiware-service', 'smartgondor')
|
|
198
199
|
.matchHeader('fiware-servicepath', 'electricity')
|
|
199
200
|
.matchHeader('X-Auth-Token', '12345679ABCDEF')
|
|
200
|
-
.post('/v2/entities?options=upsert');
|
|
201
|
+
.post('/v2/entities?options=upsert,flowControl');
|
|
201
202
|
|
|
202
203
|
iotAgentLib.activate(iotAgentConfig, done);
|
|
203
204
|
});
|
|
@@ -123,7 +123,8 @@ const iotAgentConfig = {
|
|
|
123
123
|
service: 'smartgondor',
|
|
124
124
|
subservice: 'gardens',
|
|
125
125
|
providerUrl: 'http://smartgondor.com',
|
|
126
|
-
deviceRegistrationDuration: 'P1M'
|
|
126
|
+
deviceRegistrationDuration: 'P1M',
|
|
127
|
+
useCBflowControl: true
|
|
127
128
|
};
|
|
128
129
|
const groupCreation = {
|
|
129
130
|
url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/services',
|
|
@@ -222,7 +223,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
222
223
|
contextBrokerMock
|
|
223
224
|
.matchHeader('fiware-service', 'testservice')
|
|
224
225
|
.matchHeader('fiware-servicepath', '/testingPath')
|
|
225
|
-
.post('/v2/entities?options=upsert')
|
|
226
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
226
227
|
.reply(204);
|
|
227
228
|
|
|
228
229
|
async.series(
|
|
@@ -255,7 +256,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
255
256
|
contextBrokerMock
|
|
256
257
|
.matchHeader('fiware-service', 'testservice')
|
|
257
258
|
.matchHeader('fiware-servicepath', '/testingPath')
|
|
258
|
-
.post('/v2/entities?options=upsert')
|
|
259
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
259
260
|
.reply(204);
|
|
260
261
|
|
|
261
262
|
async.series(
|
|
@@ -290,7 +291,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
290
291
|
contextBrokerMock
|
|
291
292
|
.matchHeader('fiware-service', 'testservice')
|
|
292
293
|
.matchHeader('fiware-servicepath', '/testingPath')
|
|
293
|
-
.post('/v2/entities?options=upsert')
|
|
294
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
294
295
|
.reply(204);
|
|
295
296
|
|
|
296
297
|
async.series([request.bind(request, groupCreation)], function (error, results) {
|
|
@@ -326,7 +327,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
326
327
|
contextBrokerMock
|
|
327
328
|
.matchHeader('fiware-service', 'testservice')
|
|
328
329
|
.matchHeader('fiware-servicepath', '/testingPath')
|
|
329
|
-
.post('/v2/entities?options=upsert')
|
|
330
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
330
331
|
.reply(204);
|
|
331
332
|
|
|
332
333
|
async.series([request.bind(request, configGroupCreation)], function (error, results) {
|
|
@@ -48,7 +48,8 @@ const iotAgentConfig = {
|
|
|
48
48
|
service: 'smartgondor',
|
|
49
49
|
subservice: 'gardens',
|
|
50
50
|
providerUrl: 'http://smartgondor.com',
|
|
51
|
-
deviceRegistrationDuration: 'P1M'
|
|
51
|
+
deviceRegistrationDuration: 'P1M',
|
|
52
|
+
useCBflowControl: true
|
|
52
53
|
};
|
|
53
54
|
let contextBrokerMock;
|
|
54
55
|
|
|
@@ -64,7 +65,7 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
64
65
|
describe('When a the registry is queried for a device using an arbitrary attribute', function () {
|
|
65
66
|
beforeEach(function (done) {
|
|
66
67
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
67
|
-
.post('/v2/entities?options=upsert')
|
|
68
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
68
69
|
.times(10)
|
|
69
70
|
.matchHeader('fiware-service', 'smartgondor')
|
|
70
71
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
@@ -116,7 +117,7 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
116
117
|
describe('When a the registry is queried for devices in multiple services', function () {
|
|
117
118
|
beforeEach(function (done) {
|
|
118
119
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
119
|
-
.post('/v2/entities?options=upsert')
|
|
120
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
120
121
|
.times(10)
|
|
121
122
|
.reply(204);
|
|
122
123
|
|
|
@@ -159,7 +160,7 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
159
160
|
describe('When a the registry is queried for devices in a particular service', function () {
|
|
160
161
|
beforeEach(function (done) {
|
|
161
162
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
162
|
-
.post('/v2/entities?options=upsert')
|
|
163
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
163
164
|
.times(10)
|
|
164
165
|
.reply(204);
|
|
165
166
|
|
|
@@ -202,7 +203,7 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
202
203
|
describe('When a the registry is queried for device in a particular name and type', function () {
|
|
203
204
|
beforeEach(function (done) {
|
|
204
205
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
205
|
-
.post('/v2/entities?options=upsert')
|
|
206
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
206
207
|
.times(10)
|
|
207
208
|
.reply(204);
|
|
208
209
|
|
|
@@ -75,8 +75,6 @@ describe('dbConn.configureDb', function () {
|
|
|
75
75
|
expected: {
|
|
76
76
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
77
77
|
options: {
|
|
78
|
-
useNewUrlParser: true,
|
|
79
|
-
useUnifiedTopology: true
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
},
|
|
@@ -88,8 +86,6 @@ describe('dbConn.configureDb', function () {
|
|
|
88
86
|
expected: {
|
|
89
87
|
url: 'mongodb://example.com:98765/' + dbConn.DEFAULT_DB_NAME,
|
|
90
88
|
options: {
|
|
91
|
-
useNewUrlParser: true,
|
|
92
|
-
useUnifiedTopology: true
|
|
93
89
|
}
|
|
94
90
|
}
|
|
95
91
|
},
|
|
@@ -101,8 +97,6 @@ describe('dbConn.configureDb', function () {
|
|
|
101
97
|
expected: {
|
|
102
98
|
url: 'mongodb://example.com:27017/examples',
|
|
103
99
|
options: {
|
|
104
|
-
useNewUrlParser: true,
|
|
105
|
-
useUnifiedTopology: true
|
|
106
100
|
}
|
|
107
101
|
}
|
|
108
102
|
},
|
|
@@ -114,9 +108,7 @@ describe('dbConn.configureDb', function () {
|
|
|
114
108
|
expected: {
|
|
115
109
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
116
110
|
options: {
|
|
117
|
-
replicaSet: 'rs0'
|
|
118
|
-
useNewUrlParser: true,
|
|
119
|
-
useUnifiedTopology: true
|
|
111
|
+
replicaSet: 'rs0'
|
|
120
112
|
}
|
|
121
113
|
}
|
|
122
114
|
},
|
|
@@ -128,8 +120,6 @@ describe('dbConn.configureDb', function () {
|
|
|
128
120
|
expected: {
|
|
129
121
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
130
122
|
options: {
|
|
131
|
-
useNewUrlParser: true,
|
|
132
|
-
useUnifiedTopology: true
|
|
133
123
|
}
|
|
134
124
|
}
|
|
135
125
|
},
|
|
@@ -141,8 +131,6 @@ describe('dbConn.configureDb', function () {
|
|
|
141
131
|
expected: {
|
|
142
132
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
143
133
|
options: {
|
|
144
|
-
useNewUrlParser: true,
|
|
145
|
-
useUnifiedTopology: true
|
|
146
134
|
}
|
|
147
135
|
}
|
|
148
136
|
},
|
|
@@ -158,9 +146,7 @@ describe('dbConn.configureDb', function () {
|
|
|
158
146
|
auth: {
|
|
159
147
|
user: 'user01',
|
|
160
148
|
password: 'pass01'
|
|
161
|
-
}
|
|
162
|
-
useNewUrlParser: true,
|
|
163
|
-
useUnifiedTopology: true
|
|
149
|
+
}
|
|
164
150
|
}
|
|
165
151
|
}
|
|
166
152
|
},
|
|
@@ -172,8 +158,6 @@ describe('dbConn.configureDb', function () {
|
|
|
172
158
|
expected: {
|
|
173
159
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
174
160
|
options: {
|
|
175
|
-
useNewUrlParser: true,
|
|
176
|
-
useUnifiedTopology: true
|
|
177
161
|
}
|
|
178
162
|
}
|
|
179
163
|
},
|
|
@@ -194,9 +178,7 @@ describe('dbConn.configureDb', function () {
|
|
|
194
178
|
auth: {
|
|
195
179
|
user: 'user01',
|
|
196
180
|
password: 'pass01'
|
|
197
|
-
}
|
|
198
|
-
useNewUrlParser: true,
|
|
199
|
-
useUnifiedTopology: true
|
|
181
|
+
}
|
|
200
182
|
}
|
|
201
183
|
}
|
|
202
184
|
},
|
|
@@ -208,9 +190,7 @@ describe('dbConn.configureDb', function () {
|
|
|
208
190
|
expected: {
|
|
209
191
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
210
192
|
options: {
|
|
211
|
-
ssl: true
|
|
212
|
-
useNewUrlParser: true,
|
|
213
|
-
useUnifiedTopology: true
|
|
193
|
+
ssl: true
|
|
214
194
|
}
|
|
215
195
|
}
|
|
216
196
|
},
|
|
@@ -224,8 +204,6 @@ describe('dbConn.configureDb', function () {
|
|
|
224
204
|
expected: {
|
|
225
205
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME + '?retryWrites=true',
|
|
226
206
|
options: {
|
|
227
|
-
useNewUrlParser: true,
|
|
228
|
-
useUnifiedTopology: true
|
|
229
207
|
}
|
|
230
208
|
}
|
|
231
209
|
},
|
|
@@ -243,8 +221,6 @@ describe('dbConn.configureDb', function () {
|
|
|
243
221
|
dbConn.DEFAULT_DB_NAME +
|
|
244
222
|
'?retryWrites=true&readPreference=nearest',
|
|
245
223
|
options: {
|
|
246
|
-
useNewUrlParser: true,
|
|
247
|
-
useUnifiedTopology: true
|
|
248
224
|
}
|
|
249
225
|
}
|
|
250
226
|
},
|
|
@@ -256,8 +232,6 @@ describe('dbConn.configureDb', function () {
|
|
|
256
232
|
expected: {
|
|
257
233
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
258
234
|
options: {
|
|
259
|
-
useNewUrlParser: true,
|
|
260
|
-
useUnifiedTopology: true
|
|
261
235
|
}
|
|
262
236
|
}
|
|
263
237
|
},
|
|
@@ -269,8 +243,6 @@ describe('dbConn.configureDb', function () {
|
|
|
269
243
|
expected: {
|
|
270
244
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
271
245
|
options: {
|
|
272
|
-
useNewUrlParser: true,
|
|
273
|
-
useUnifiedTopology: true
|
|
274
246
|
}
|
|
275
247
|
}
|
|
276
248
|
},
|
|
@@ -282,8 +254,6 @@ describe('dbConn.configureDb', function () {
|
|
|
282
254
|
expected: {
|
|
283
255
|
url: 'mongodb://example.com:27017/' + dbConn.DEFAULT_DB_NAME,
|
|
284
256
|
options: {
|
|
285
|
-
useNewUrlParser: true,
|
|
286
|
-
useUnifiedTopology: true
|
|
287
257
|
}
|
|
288
258
|
}
|
|
289
259
|
},
|
|
@@ -312,9 +282,7 @@ describe('dbConn.configureDb', function () {
|
|
|
312
282
|
user: 'user01',
|
|
313
283
|
password: 'pass01'
|
|
314
284
|
},
|
|
315
|
-
ssl: true
|
|
316
|
-
useNewUrlParser: true,
|
|
317
|
-
useUnifiedTopology: true
|
|
285
|
+
ssl: true
|
|
318
286
|
}
|
|
319
287
|
}
|
|
320
288
|
}
|
|
@@ -330,7 +298,7 @@ describe('dbConn.configureDb', function () {
|
|
|
330
298
|
const cfg = Object.assign({}, iotAgentConfig, {
|
|
331
299
|
mongodb: params.mongodb
|
|
332
300
|
});
|
|
333
|
-
stub = sinon.stub(mongoose, '
|
|
301
|
+
stub = sinon.stub(mongoose, 'connect').callsFake(function (url, options, fn) {
|
|
334
302
|
url.should.be.equal(params.expected.url);
|
|
335
303
|
options.should.be.eql(params.expected.options);
|
|
336
304
|
done();
|
|
@@ -365,7 +333,7 @@ describe('dbConn.configureDb', function () {
|
|
|
365
333
|
const cfg = Object.assign({}, iotAgentConfig, {
|
|
366
334
|
mongodb: params.mongodb
|
|
367
335
|
});
|
|
368
|
-
stub = sinon.stub(mongoose, '
|
|
336
|
+
stub = sinon.stub(mongoose, 'connect').callsFake(function (url, options, fn) {
|
|
369
337
|
should.fail();
|
|
370
338
|
});
|
|
371
339
|
config.setConfig(cfg);
|
|
@@ -253,8 +253,7 @@ const iotAgentConfig = {
|
|
|
253
253
|
service: 'smartgondor',
|
|
254
254
|
subservice: 'gardens',
|
|
255
255
|
providerUrl: 'http://smartgondor.com',
|
|
256
|
-
deviceRegistrationDuration: 'P1M'
|
|
257
|
-
throttling: 'PT5S'
|
|
256
|
+
deviceRegistrationDuration: 'P1M'
|
|
258
257
|
};
|
|
259
258
|
|
|
260
259
|
const iotAgentConfigTS = {
|
|
@@ -59,8 +59,7 @@ const iotAgentConfig = {
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
providerUrl: 'http://smartgondor.com',
|
|
62
|
-
deviceRegistrationDuration: 'P1M'
|
|
63
|
-
throttling: 'PT5S'
|
|
62
|
+
deviceRegistrationDuration: 'P1M'
|
|
64
63
|
};
|
|
65
64
|
|
|
66
65
|
describe('NGSI-LD - JSON-LD @context parsing from environment variable', function () {
|
|
@@ -55,7 +55,8 @@ const iotAgentConfig = {
|
|
|
55
55
|
service: 'smartgondor',
|
|
56
56
|
subservice: 'gardens',
|
|
57
57
|
providerUrl: 'http://smartgondor.com',
|
|
58
|
-
deviceRegistrationDuration: 'P1M'
|
|
58
|
+
deviceRegistrationDuration: 'P1M',
|
|
59
|
+
useCBflowControl: true
|
|
59
60
|
};
|
|
60
61
|
const mongo = require('mongodb').MongoClient;
|
|
61
62
|
const mongoUtils = require('../../mongodb/mongoDBUtils');
|
|
@@ -68,6 +69,7 @@ const optionsCreationDefault = {
|
|
|
68
69
|
apikey: 'default-test',
|
|
69
70
|
entity_type: 'Device',
|
|
70
71
|
resource: '/iot/default',
|
|
72
|
+
useCBflowControl: true,
|
|
71
73
|
attributes: [
|
|
72
74
|
{
|
|
73
75
|
object_id: 's',
|
|
@@ -93,6 +95,7 @@ const optionsCreationV2 = {
|
|
|
93
95
|
ngsiVersion: 'v2',
|
|
94
96
|
entity_type: 'Device',
|
|
95
97
|
resource: '/iot/v2',
|
|
98
|
+
useCBflowControl: true,
|
|
96
99
|
attributes: [
|
|
97
100
|
{
|
|
98
101
|
object_id: 's',
|
|
@@ -189,7 +192,7 @@ describe('Mixed Mode: ngsiVersion test', function () {
|
|
|
189
192
|
nock.cleanAll();
|
|
190
193
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
191
194
|
.matchHeader('fiware-service', 'smartgondor')
|
|
192
|
-
.post('/v2/entities?options=upsert')
|
|
195
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
193
196
|
.reply(204);
|
|
194
197
|
|
|
195
198
|
request(optionsCreationDefault, function (error, response, body) {
|
|
@@ -210,7 +213,7 @@ describe('Mixed Mode: ngsiVersion test', function () {
|
|
|
210
213
|
nock.cleanAll();
|
|
211
214
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
212
215
|
.matchHeader('fiware-service', 'smartgondor')
|
|
213
|
-
.post('/v2/entities?options=upsert')
|
|
216
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
214
217
|
.reply(204);
|
|
215
218
|
|
|
216
219
|
request(optionsCreationV2, function (error, response, body) {
|
|
@@ -254,10 +257,10 @@ describe('Mixed Mode: ngsiVersion test', function () {
|
|
|
254
257
|
// contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
255
258
|
// .matchHeader('fiware-service', 'smartgondor')
|
|
256
259
|
// .matchHeader('fiware-servicepath', 'gardens')
|
|
257
|
-
// .post('/v2/entities?options=upsert')
|
|
260
|
+
// .post('/v2/entities?options=upsert,flowControl')
|
|
258
261
|
// .reply(204);
|
|
259
262
|
|
|
260
|
-
// contextBrokerMock = nock('http://192.168.1.1:1026').post('/v2/entities?options=upsert').reply(204);
|
|
263
|
+
// contextBrokerMock = nock('http://192.168.1.1:1026').post('/v2/entities?options=upsert,flowControl').reply(204);
|
|
261
264
|
// request(optionsCreationLD, function (error, response, body) {
|
|
262
265
|
// request(deviceCreationV2, function (error, response, body) {
|
|
263
266
|
// done();
|