@@ -385,41 +385,6 @@ describe('Java expression language (JEXL) based transformations plugin', functio
385385 } ) ;
386386 } ) ;
387387
388- describe ( 'When an update comes for attributes with string expression and type integer' , function ( ) {
389- // Case: Update for an integer attribute with string expression
390- const values = [
391- {
392- name : 'e' ,
393- type : 'Number' ,
394- value : 52
395- }
396- ] ;
397-
398- beforeEach ( function ( ) {
399- nock . cleanAll ( ) ;
400-
401- contextBrokerMock = nock ( 'http://192.168.1.1:1026' )
402- . matchHeader ( 'fiware-service' , 'smartgondor' )
403- . matchHeader ( 'fiware-servicepath' , 'gardens' )
404- . post (
405- '/v2/entities/ws1/attrs' ,
406- utils . readExampleFile (
407- './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin11.json'
408- )
409- )
410- . query ( { type : 'WeatherStation' } )
411- . reply ( 204 ) ;
412- } ) ;
413-
414- it ( 'should apply the expression before sending the values' , function ( done ) {
415- iotAgentLib . update ( 'ws1' , 'WeatherStationMultiple' , '' , values , function ( error ) {
416- should . not . exist ( error ) ;
417- contextBrokerMock . done ( ) ;
418- done ( ) ;
419- } ) ;
420- } ) ;
421- } ) ;
422-
423388 describe ( 'When an update comes for attributes without expressions and type float' , function ( ) {
424389 // Case: Update for a Float attribute without expressions
425390
@@ -492,42 +457,6 @@ describe('Java expression language (JEXL) based transformations plugin', functio
492457 } ) ;
493458 } ) ;
494459
495- describe ( 'When an update comes for attributes with string expressions and type float' , function ( ) {
496- // Case: Update for a Float attribute with string expression
497-
498- const values = [
499- {
500- name : 'e' ,
501- type : 'Number' ,
502- value : 0.44
503- }
504- ] ;
505-
506- beforeEach ( function ( ) {
507- nock . cleanAll ( ) ;
508-
509- contextBrokerMock = nock ( 'http://192.168.1.1:1026' )
510- . matchHeader ( 'fiware-service' , 'smartgondor' )
511- . matchHeader ( 'fiware-servicepath' , 'gardens' )
512- . post (
513- '/v2/entities/ws1/attrs' ,
514- utils . readExampleFile (
515- './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin3.json'
516- )
517- )
518- . query ( { type : 'WeatherStation' } )
519- . reply ( 204 ) ;
520- } ) ;
521-
522- it ( 'should apply the expression before sending the values' , function ( done ) {
523- iotAgentLib . update ( 'ws1' , 'WeatherStationMultiple' , '' , values , function ( error ) {
524- should . not . exist ( error ) ;
525- contextBrokerMock . done ( ) ;
526- done ( ) ;
527- } ) ;
528- } ) ;
529- } ) ;
530-
531460 describe ( 'When an update comes for attributes without expressions and NULL type' , function ( ) {
532461 // Case: Update for a Null attribute without expression
533462
@@ -564,78 +493,6 @@ describe('Java expression language (JEXL) based transformations plugin', functio
564493 } ) ;
565494 } ) ;
566495
567- describe ( 'When an update comes for attributes with numeric expressions and NULL type' , function ( ) {
568- // Case: Update for a Null attribute with arithmetic expression
569-
570- const values = [
571- {
572- name : 'a' ,
573- type : 'None' ,
574- value : null
575- }
576- ] ;
577-
578- beforeEach ( function ( ) {
579- nock . cleanAll ( ) ;
580-
581- contextBrokerMock = nock ( 'http://192.168.1.1:1026' )
582- . matchHeader ( 'fiware-service' , 'smartgondor' )
583- . matchHeader ( 'fiware-servicepath' , 'gardens' )
584- . post (
585- '/v2/entities/ws1/attrs' ,
586- utils . readExampleFile (
587- './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin5.json'
588- )
589- )
590- . query ( { type : 'WeatherStation' } )
591- . reply ( 204 ) ;
592- } ) ;
593-
594- it ( 'should apply the expression before sending the values' , function ( done ) {
595- iotAgentLib . update ( 'ws1' , 'WeatherStation' , '' , values , function ( error ) {
596- should . not . exist ( error ) ;
597- contextBrokerMock . done ( ) ;
598- done ( ) ;
599- } ) ;
600- } ) ;
601- } ) ;
602-
603- describe ( 'When an update comes for attributes with string expressions and NULL type' , function ( ) {
604- // Case: Update for a Null attribute with string expression
605-
606- const values = [
607- {
608- name : 'a' ,
609- type : 'None' ,
610- value : null
611- }
612- ] ;
613-
614- beforeEach ( function ( ) {
615- nock . cleanAll ( ) ;
616-
617- contextBrokerMock = nock ( 'http://192.168.1.1:1026' )
618- . matchHeader ( 'fiware-service' , 'smartgondor' )
619- . matchHeader ( 'fiware-servicepath' , 'gardens' )
620- . post (
621- '/v2/entities/ws1/attrs' ,
622- utils . readExampleFile (
623- './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin5.json'
624- )
625- )
626- . query ( { type : 'WeatherStation' } )
627- . reply ( 204 ) ;
628- } ) ;
629-
630- it ( 'should apply the expression before sending the values' , function ( done ) {
631- iotAgentLib . update ( 'ws1' , 'WeatherStationMultiple' , '' , values , function ( error ) {
632- should . not . exist ( error ) ;
633- contextBrokerMock . done ( ) ;
634- done ( ) ;
635- } ) ;
636- } ) ;
637- } ) ;
638-
639496 describe ( 'When an update comes for attributes without expressions and Boolean type' , function ( ) {
640497 // Case: Update for a Boolean attribute without expression
641498
@@ -672,77 +529,6 @@ describe('Java expression language (JEXL) based transformations plugin', functio
672529 } ) ;
673530 } ) ;
674531
675- describe ( 'When an update comes for attributes with numeric expressions and Boolean type' , function ( ) {
676- // Case: Update for a Boolean attribute with arithmetic expression
677-
678- const values = [
679- {
680- name : 'u' ,
681- type : 'Boolean' ,
682- value : true
683- }
684- ] ;
685-
686- beforeEach ( function ( ) {
687- nock . cleanAll ( ) ;
688-
689- contextBrokerMock = nock ( 'http://192.168.1.1:1026' )
690- . matchHeader ( 'fiware-service' , 'smartgondor' )
691- . matchHeader ( 'fiware-servicepath' , 'gardens' )
692- . post (
693- '/v2/entities/ws1/attrs' ,
694- utils . readExampleFile (
695- './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin10.json'
696- )
697- )
698- . query ( { type : 'WeatherStation' } )
699- . reply ( 204 ) ;
700- } ) ;
701-
702- it ( 'should apply the expression before sending the values' , function ( done ) {
703- iotAgentLib . update ( 'ws1' , 'WeatherStation' , '' , values , function ( error ) {
704- should . not . exist ( error ) ;
705- contextBrokerMock . done ( ) ;
706- done ( ) ;
707- } ) ;
708- } ) ;
709- } ) ;
710-
711- describe ( 'When an update comes for attributes with string expressions and Boolean type' , function ( ) {
712- // Case: Update for a Boolean attribute with string expression
713- const values = [
714- {
715- name : 'u' ,
716- type : 'Boolean' ,
717- value : true
718- }
719- ] ;
720-
721- beforeEach ( function ( ) {
722- nock . cleanAll ( ) ;
723-
724- contextBrokerMock = nock ( 'http://192.168.1.1:1026' )
725- . matchHeader ( 'fiware-service' , 'smartgondor' )
726- . matchHeader ( 'fiware-servicepath' , 'gardens' )
727- . post (
728- '/v2/entities/ws1/attrs' ,
729- utils . readExampleFile (
730- './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin9.json'
731- )
732- )
733- . query ( { type : 'WeatherStation' } )
734- . reply ( 204 ) ;
735- } ) ;
736-
737- it ( 'should apply the expression before sending the values' , function ( done ) {
738- iotAgentLib . update ( 'ws1' , 'WeatherStationMultiple' , '' , values , function ( error ) {
739- should . not . exist ( error ) ;
740- contextBrokerMock . done ( ) ;
741- done ( ) ;
742- } ) ;
743- } ) ;
744- } ) ;
745-
746532 describe ( 'When an update comes for attributes without expressions and Object type' , function ( ) {
747533 // Case: Update for a JSON document attribute without expression
748534 const values = [
0 commit comments