diff --git a/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js b/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js index e078cf6cb..40d0261b4 100644 --- a/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js +++ b/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js @@ -159,10 +159,6 @@ describe('NGSI-LD - Merge-Patch functionalities', function () { let handlerCalled = 0; iotAgentLib.setMergePatchHandler(function (id, type, service, subservice, attributes, callback) { - console.error('======'); - console.error(id, type, service, subservice, attributes, callback); - console.error('======'); - id.should.equal('urn:ngsi-ld:' + device3.type + ':' + device3.id); type.should.equal(device3.type); attributes[0].name.should.equal('position'); diff --git a/test/unit/ngsi-ld/provisioning/device-registration_test.js b/test/unit/ngsi-ld/provisioning/device-registration_test.js index f62a99b96..3b9bd6e04 100644 --- a/test/unit/ngsi-ld/provisioning/device-registration_test.js +++ b/test/unit/ngsi-ld/provisioning/device-registration_test.js @@ -109,19 +109,10 @@ describe('NGSI-LD - IoT Agent Device Registration', function () { describe('When a new device is connected to the IoT Agent', function () { beforeEach(function (done) { nock.cleanAll(); - - // This mock does not check the payload since the aim of the test is not to verify - // device provisioning functionality. Appropriate verification is done in tests under - // provisioning folder - contextBrokerMock = nock('http://192.168.1.1:1026') - .matchHeader('fiware-service', 'smartgondor') - .post('/ngsi-ld/v1/entityOperations/upsert/') - .reply(204); - const nockBody = utils.readExampleFile( './test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent1.json' ); - contextBrokerMock + contextBrokerMock = nock('http://192.168.1.1:1026') .matchHeader('fiware-service', 'smartgondor') .post('/ngsi-ld/v1/csourceRegistrations/', nockBody) .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' }); diff --git a/test/unit/ngsi-ld/provisioning/device-update-registration_test.js b/test/unit/ngsi-ld/provisioning/device-update-registration_test.js index 1aa86dffd..912943855 100644 --- a/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +++ b/test/unit/ngsi-ld/provisioning/device-update-registration_test.js @@ -148,14 +148,6 @@ describe('NGSI-LD - IoT Agent Device Update Registration', function () { .post('/ngsi-ld/v1/csourceRegistrations/') .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' }); - // This mock does not check the payload since the aim of the test is not to verify - // device provisioning functionality. Appropriate verification is done in tests under - // provisioning folder - contextBrokerMock - .matchHeader('fiware-service', 'smartgondor') - .post('/ngsi-ld/v1/entityOperations/upsert/') - .reply(204); - iotAgentLib.activate(iotAgentConfig, function (error) { iotAgentLib.register(device1, function (error) { done(); diff --git a/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js b/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js index 0dfc0c4e1..f3ca4dd4d 100644 --- a/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js +++ b/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js @@ -130,14 +130,6 @@ describe('NGSI-LD - Provisioning API: Single service mode', function () { .post('/ngsi-ld/v1/csourceRegistrations/') .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' }); - // This mock does not check the payload since the aim of the test is not to verify - // device provisioning functionality. Appropriate verification is done in tests under - // provisioning folder - contextBrokerMock - .matchHeader('fiware-service', 'testservice') - .post('/ngsi-ld/v1/entityOperations/upsert/') - .reply(204); - request(groupCreation, function (error) { request(deviceCreation, function (error, response, body) { done(); @@ -183,27 +175,11 @@ describe('NGSI-LD - Provisioning API: Single service mode', function () { .post('/ngsi-ld/v1/csourceRegistrations/') .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' }); - // This mock does not check the payload since the aim of the test is not to verify - // device provisioning functionality. Appropriate verification is done in tests under - // provisioning folder - contextBrokerMock - .matchHeader('fiware-service', 'testservice') - .post('/ngsi-ld/v1/entityOperations/upsert/') - .reply(204); - contextBrokerMock = nock('http://192.168.1.1:1026') .matchHeader('fiware-service', 'AlternateService') .post('/ngsi-ld/v1/csourceRegistrations/') .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' }); - // This mock does not check the payload since the aim of the test is not to verify - // device provisioning functionality. Appropriate verification is done in tests under - // provisioning folder - contextBrokerMock - .matchHeader('fiware-service', 'AlternateService') - .post('/ngsi-ld/v1/entityOperations/upsert/') - .reply(204); - request(groupCreation, function (error) { request(deviceCreation, function (error, response, body) { request(alternativeGroupCreation, function (error, response, body) { @@ -280,16 +256,6 @@ describe('NGSI-LD - Provisioning API: Single service mode', function () { ) .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' }); - contextBrokerMock - .matchHeader('fiware-service', 'testservice') - .post( - '/ngsi-ld/v1/entityOperations/upsert/', - utils.readExampleFile( - './test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic.json' - ) - ) - .reply(204); - request(groupCreation, done); });