Skip to content

Commit

Permalink
Merge pull request #840 from telefonicaid/AlvaroVega-patch-1
Browse files Browse the repository at this point in the history
disable  subscription_management test
  • Loading branch information
fgalan authored Sep 18, 2024
2 parents 3baee36 + f2ffb62 commit 67de4f7
Showing 1 changed file with 43 additions and 39 deletions.
82 changes: 43 additions & 39 deletions test/unit/ngsiv2/_subscription-management_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,45 +92,49 @@ describe('Subscription management', function () {
iotAgentLib.clearAll(done);
});

describe('When the iotagent stops', function () {
beforeEach(function () {
contextBrokerMock
.matchHeader('fiware-service', 'smartgondor')
.matchHeader('fiware-servicepath', '/gardens')
.post(
'/v2/entities?options=upsert',
utils.readExampleFile('./test/unit/ngsiv2/contextRequests/multipleMeasures.json')
)
.reply(204);

contextBrokerMock
.matchHeader('fiware-service', 'smartgondor')
.matchHeader('fiware-servicepath', '/gardens')
.post(
'/v2/entities?options=upsert',
utils.readExampleFile('./test/unit/ngsiv2/contextRequests/alternativeUpdate.json')
)
.reply(204);
});

it('should cease sending measures to the CB', function (done) {
async.series(
[
async.apply(request, provisionOptions),
sendMeasures('32', '87'),
waitForMqttRelay(50),
iotaJson.stop,
sendMeasures('53', '1'),
waitForMqttRelay(50)
],
function (error, results) {
should.not.exist(error);
contextBrokerMock.isDone().should.equal(false);
done();
}
);
});
});
// FIXME: following test is not working as expected. The second mock expectations (the one with
// alternativeUpdate.json, which includes the NGSIv2 update for 53 and 1 measures) is not correct,
// as the IOTA is stopedd with iotaJson.stop before doing sendMeasures('53', '1'). Surprisingly, removing
// that expectation doesn't work either...
// describe('When the iotagent stops', function () {
// beforeEach(function () {
// contextBrokerMock
// .matchHeader('fiware-service', 'smartgondor')
// .matchHeader('fiware-servicepath', '/gardens')
// .post(
// '/v2/entities?options=upsert',
// utils.readExampleFile('./test/unit/ngsiv2/contextRequests/multipleMeasures.json')
// )
// .reply(204);

// contextBrokerMock
// .matchHeader('fiware-service', 'smartgondor')
// .matchHeader('fiware-servicepath', '/gardens')
// .post(
// '/v2/entities?options=upsert',
// utils.readExampleFile('./test/unit/ngsiv2/contextRequests/alternativeUpdate.json')
// )
// .reply(204);
// });

// it('should cease sending measures to the CB', function (done) {
// async.series(
// [
// async.apply(request, provisionOptions),
// sendMeasures('32', '87'),
// waitForMqttRelay(50),
// iotaJson.stop,
// sendMeasures('53', '1'),
// waitForMqttRelay(50)
// ],
// function (error, results) {
// should.not.exist(error);
// contextBrokerMock.isDone().should.equal(false);
// done();
// }
// );
// });
// });

describe('When the iotagent starts', function () {
beforeEach(function () {
Expand Down

0 comments on commit 67de4f7

Please sign in to comment.