Skip to content

Commit

Permalink
Merge pull request telefonicaid#1568 from telefonicaid/improve-test
Browse files Browse the repository at this point in the history
FIX improve test case
  • Loading branch information
mapedraza authored Jan 31, 2024
2 parents 721a504 + 8910b90 commit 37403e5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/unit/ngsiv2/ngsiService/active-devices-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,24 +905,27 @@ describe('NGSI-v2 - Active attributes test', function () {
const valuesIdType = [
{
name: 'id',
type: 'text',
type: 'aTypeProvidedByIoTACodeCallingUpdateOnLib1',
value: 'idIoTA'
},
{
name: 'type',
type: 'text',
type: 'aTypeProvidedByIoTACodeCallingUpdateOnLib2',
value: 'typeIoTA'
},
{
name: 'm',
type: 'text',
type: 'aTypeProvidedByIoTACodeCallingUpdateOnLib3',
value: 'measIoTA'
}
];

beforeEach(function (done) {
nock.cleanAll();

// Note that in the case of measure_id and measure_type the type provided by the IOTA when calling iotAgentLib.update()
// is used (thus ignoring the one of the StupidDevice group for id or type, which is 'text') but in the case of measIoTA the type provided in the
// provisioning ('String') is used
contextBrokerMock = nock('http://192.168.1.1:1026')
.matchHeader('fiware-service', 'smartgondor')
.matchHeader('fiware-servicepath', 'gardens')
Expand All @@ -934,11 +937,11 @@ describe('NGSI-v2 - Active attributes test', function () {
type: 'String'
},
measure_id: {
type: 'text',
type: 'aTypeProvidedByIoTACodeCallingUpdateOnLib1',
value: 'idIoTA'
},
measure_type: {
type: 'text',
type: 'aTypeProvidedByIoTACodeCallingUpdateOnLib2',
value: 'typeIoTA'
}
})
Expand Down

0 comments on commit 37403e5

Please sign in to comment.