forked from FIWARE/NGSI-LD_TestSuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatch_operations_delete_test.js
43 lines (32 loc) · 1.14 KB
/
batch_operations_delete_test.js
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
const testedResource = require('../common.js').testedResource;
const http = require('../http.js');
const entitiesResource = testedResource + '/entities/';
const batchDeleteResource = testedResource + '/entityOperations/delete';
describe('Batch Entity Deletion. JSON', () => {
const entity1 = {
id: 'urn:ngsi-ld:T:' + new Date().getTime(),
type: 'T'
};
const entity2 = {
id: 'urn:ngsi-ld:T:' + new Date().getTime() + 1,
type: 'T',
P1: {
type: 'Property',
value: 'Hola'
}
};
const entities = [entity1, entity2];
beforeAll(() => {
const requests = [];
for (let j = 0; j < entities.length; j++) {
requests.push(http.post(entitiesResource, entities[j]));
}
return Promise.all(requests);
});
it('should delete a list of entities 002', async function() {
const entityIds = [entity1.id, entity2.id];
const response = await http.post(batchDeleteResource, entityIds);
expect(response.response).toHaveProperty('statusCode', 204);
//assertBatchOperation(response, entityIds, []);
});
});