diff --git a/README.md b/README.md index f3a724f..d86cf4e 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,10 @@ DEVICE_PASSWORD=xxx #### v1.1.0 Release v.1.1.0 introduces the integration with a Kafka message broker. +Notification types: - *Controller notifications*: handling of Controller notifications has not been changed. Those are not pushed to Kafka, applications interested in receiving those still need to subscribe to NotificationProxy directly. (This decision is based on the fact, that in the future Controller notifications will not be handed over from Controller to NP directly, but will be managed by future app Controller Domain Manager.) - *Device change and alarm notifications*: Handling of device change notifications however has changed - those are now pushed to Kafka. -- *Proprietary notifications*: those are ignored for now. +- *Proprietary notifications*: those are not received and managed by NotificationProxy and, thus, out of scope. Kafka sends all ONF TR52 device change notifications to Kafka topic *all_notifications* after bringing them into the required format (in regards to the included resource path). Sorting the notifications into separate topics (e.g. *device_change_notifications* and *device_alarm_notifications*) on Kafka, from where consumers then can pull them, will not be done by the NotificationProxy but by other means (e.g. a KafkaStreams application). diff --git a/testing/2_functional/completeness/v1.1.0/tmp_input/oas_services_testing_prep.yaml b/Z_WIP_TestingPrep/oas_services_testing_prep.yaml similarity index 100% rename from testing/2_functional/completeness/v1.1.0/tmp_input/oas_services_testing_prep.yaml rename to Z_WIP_TestingPrep/oas_services_testing_prep.yaml diff --git a/testing/2_functional/completeness/v1.1.0/schema/NetExplorerProxy+json.json b/testing/2_functional/completeness/v1.1.0/schema/NetExplorerProxy+json.json deleted file mode 100644 index d108e9b..0000000 --- a/testing/2_functional/completeness/v1.1.0/schema/NetExplorerProxy+json.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "todo": { - "type": "string" - } -} \ No newline at end of file diff --git a/testing/2_functional/completeness/v1.1.0/schema/NetExplorerProxy+yaml.yaml b/testing/2_functional/completeness/v1.1.0/schema/NetExplorerProxy+yaml.yaml deleted file mode 100644 index 4d94406..0000000 --- a/testing/2_functional/completeness/v1.1.0/schema/NetExplorerProxy+yaml.yaml +++ /dev/null @@ -1 +0,0 @@ -todo \ No newline at end of file diff --git a/testing/2_functional/completeness/v1.1.0/schema/info.txt b/testing/2_functional/completeness/v1.1.0/schema/info.txt new file mode 100644 index 0000000..75c62bd --- /dev/null +++ b/testing/2_functional/completeness/v1.1.0/schema/info.txt @@ -0,0 +1 @@ +currently all individual NP services return 204, i.e. no schemas needed. \ No newline at end of file diff --git a/testing/2_functional/completeness/v1.1.0/simulators/NetExplorerProxy+simu.yaml b/testing/2_functional/completeness/v1.1.0/simulators/NetExplorerProxy+simu.yaml index 468d009..b05fec3 100644 --- a/testing/2_functional/completeness/v1.1.0/simulators/NetExplorerProxy+simu.yaml +++ b/testing/2_functional/completeness/v1.1.0/simulators/NetExplorerProxy+simu.yaml @@ -9,8 +9,656 @@ paths: # NP_1.1.0+simulator.completeness in static reference mode ######################################################################################################################## - /todo: - xyz + /v1/add-controller: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: addController + summary: 'Creates Tcp-, Http- and OperationClients of additional ODLn from OdlTemplate and adds FcPorts to the FCs of the callbacks section' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - controller-name + - controller-release + - controller-protocol + - controller-address + - controller-port + properties: + controller-name: + type: string + pattern: '^OpenDayLight([0-9]{1,2})$' + controller-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + controller-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + controller-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + controller-port: + type: integer + minimum: 0 + maximum: 65535 + example: + controller-name: 'OpenDayLight2' + controller-release: '4.0.2' + controller-protocol: 'HTTP' + controller-address: + ip-address: + ipv-4-address: '1.1.1.2' + controller-port: 1002 + responses: + '204': + description: 'Tcp-, Http- and OperationClients of ODLn created and connected by FcPorts' + + /v1/listen-to-controllers: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: listenToControllers + summary: 'Establishes event streams for controller and device notifications at all ODLn by initiating the callbacks defined by /v1/add-controller' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + responses: + '204': + description: 'Event streams for controller and device notifications established at all ODLn' + + /v1/remove-controller: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: removeController + summary: 'Removes FcPorts from FCs of the callbacks at /v1/add-controller and deletes Operation-, Http- and TcpClients of ODLn' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - controller-name + - controller-release + properties: + controller-name: + type: string + pattern: '^OpenDayLight([0-9]{1,2})$' + controller-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + example: + controller-name: 'OpenDayLight2' + controller-release: '4.0.2' + responses: + '204': + description: 'FcPorts, Operation-, Http- and TcpClients of ODLn removed' + + /v1/notify-controller-attribute-value-changes: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: notifyControllerAttributeValueChanges + summary: 'Offers subscription for notifications about changes of attributes at the controllers' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - subscribing-application-name + - subscribing-application-release + - subscribing-application-protocol + - subscribing-application-address + - subscribing-application-port + - notifications-receiving-operation + properties: + subscribing-application-name: + type: string + subscribing-application-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + subscribing-application-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + subscribing-application-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + subscribing-application-port: + type: integer + minimum: 0 + maximum: 65535 + notifications-receiving-operation: + type: string + minLength: 6 + example: + subscribing-application-name: 'MicroWaveDeviceInventory' + subscribing-application-release: '1.0.0' + subscribing-application-protocol: 'HTTP' + subscribing-application-address: + ip-address: + ipv-4-address: '1.1.4.4' + subscribing-application-port: 4004 + notifications-receiving-operation: '/v1/regard-controller-attribute-value-change' + responses: + '204': + description: 'Subscription for notifications about changes of attributes at the controllers created' + + /v1/notify-controller-object-creations: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: notifyControllerObjectCreations + summary: 'Offers subscription for notifications about object creations at the controllers' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - subscribing-application-name + - subscribing-application-release + - subscribing-application-protocol + - subscribing-application-address + - subscribing-application-port + - notifications-receiving-operation + properties: + subscribing-application-name: + type: string + subscribing-application-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + subscribing-application-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + subscribing-application-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + subscribing-application-port: + type: integer + minimum: 0 + maximum: 65535 + notifications-receiving-operation: + type: string + minLength: 6 + example: + subscribing-application-name: 'MicroWaveDeviceInventory' + subscribing-application-release: '1.0.0' + subscribing-application-protocol: 'HTTP' + subscribing-application-address: + ip-address: + ipv-4-address: '1.1.4.4' + subscribing-application-port: 4004 + notifications-receiving-operation: '/v1/regard-controller-object-creation' + responses: + '204': + description: 'Subscription for notifications about object creations at the controllers created' + + /v1/notify-controller-object-deletions: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: notifyControllerObjectDeletions + summary: 'Offers subscription for notifications about object deletions at the controllers' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - subscribing-application-name + - subscribing-application-release + - subscribing-application-protocol + - subscribing-application-address + - subscribing-application-port + - notifications-receiving-operation + properties: + subscribing-application-name: + type: string + subscribing-application-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + subscribing-application-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + subscribing-application-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + subscribing-application-port: + type: integer + minimum: 0 + maximum: 65535 + notifications-receiving-operation: + type: string + minLength: 6 + example: + subscribing-application-name: 'MicroWaveDeviceInventory' + subscribing-application-release: '1.0.0' + subscribing-application-protocol: 'HTTP' + subscribing-application-address: + ip-address: + ipv-4-address: '1.1.4.4' + subscribing-application-port: 4004 + notifications-receiving-operation: '/v1/regard-controller-object-deletion' + responses: + '204': + description: 'Subscription for notifications about object deletions at the controllers created' + + /v1/notify-device-alarms: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: notifyDeviceAlarms + summary: 'Offers subscription for notifications about alarms at the devices' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - subscribing-application-name + - subscribing-application-release + - subscribing-application-protocol + - subscribing-application-address + - subscribing-application-port + - notifications-receiving-operation + properties: + subscribing-application-name: + type: string + subscribing-application-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + subscribing-application-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + subscribing-application-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + subscribing-application-port: + type: integer + minimum: 0 + maximum: 65535 + notifications-receiving-operation: + type: string + minLength: 6 + example: + subscribing-application-name: 'MicroWaveDeviceInventory' + subscribing-application-release: '1.0.0' + subscribing-application-protocol: 'HTTP' + subscribing-application-address: + ip-address: + ipv-4-address: '1.1.4.4' + subscribing-application-port: 4004 + notifications-receiving-operation: '/v1/regard-device-alarm' + responses: + '204': + description: 'Subscription for notifications about alarms at the devices created' + + /v1/notify-device-attribute-value-changes: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: notifyDeviceAttributeValueChanges + summary: 'Offers subscription for notifications about changes of attributes at the devices' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - subscribing-application-name + - subscribing-application-release + - subscribing-application-protocol + - subscribing-application-address + - subscribing-application-port + - notifications-receiving-operation + properties: + subscribing-application-name: + type: string + subscribing-application-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + subscribing-application-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + subscribing-application-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + subscribing-application-port: + type: integer + minimum: 0 + maximum: 65535 + notifications-receiving-operation: + type: string + minLength: 6 + example: + subscribing-application-name: 'MicroWaveDeviceInventory' + subscribing-application-release: '1.0.0' + subscribing-application-protocol: 'HTTP' + subscribing-application-address: + ip-address: + ipv-4-address: '1.1.4.4' + subscribing-application-port: 4004 + notifications-receiving-operation: '/v1/regard-device-attribute-value-change' + responses: + '204': + description: 'Subscription for notifications about changes of attributes at the devices created' + + /v1/notify-device-object-creations: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: notifyDeviceObjectCreations + summary: 'Offers subscription for notifications about object creations at the devices' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - subscribing-application-name + - subscribing-application-release + - subscribing-application-protocol + - subscribing-application-address + - subscribing-application-port + - notifications-receiving-operation + properties: + subscribing-application-name: + type: string + subscribing-application-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + subscribing-application-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + subscribing-application-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + subscribing-application-port: + type: integer + minimum: 0 + maximum: 65535 + notifications-receiving-operation: + type: string + minLength: 6 + example: + subscribing-application-name: 'MicroWaveDeviceInventory' + subscribing-application-release: '1.0.0' + subscribing-application-protocol: 'HTTP' + subscribing-application-address: + ip-address: + ipv-4-address: '1.1.4.4' + subscribing-application-port: 4004 + notifications-receiving-operation: '/v1/regard-device-object-creation' + responses: + '204': + description: 'Subscription for notifications about object creations at the devices created' + + /v1/notify-device-object-deletions: + parameters: + - $ref: '#/components/parameters/user' + - $ref: '#/components/parameters/originator' + - $ref: '#/components/parameters/x-correlator' + - $ref: '#/components/parameters/trace-indicator' + - $ref: '#/components/parameters/customer-journey' + post: + operationId: notifyDeviceObjectDeletions + summary: 'Offers subscription for notifications about object deletions at the devices' + tags: + - IndividualServices + security: + - apiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - subscribing-application-name + - subscribing-application-release + - subscribing-application-protocol + - subscribing-application-address + - subscribing-application-port + - notifications-receiving-operation + properties: + subscribing-application-name: + type: string + subscribing-application-release: + type: string + pattern: '^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,2})$' + subscribing-application-protocol: + type: string + enum: + - 'HTTP' + - 'HTTPS' + subscribing-application-address: + type: object + minProperties: 1 + maxProperties: 1 + additionalProperties: false + properties: + ip-address: + type: object + minProperties: 1 + additionalProperties: false + properties: + ipv-4-address: + type: string + pattern: '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + domain-name: + type: string + pattern: '^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$' + subscribing-application-port: + type: integer + minimum: 0 + maximum: 65535 + notifications-receiving-operation: + type: string + minLength: 6 + example: + subscribing-application-name: 'MicroWaveDeviceInventory' + subscribing-application-release: '1.0.0' + subscribing-application-protocol: 'HTTP' + subscribing-application-address: + ip-address: + ipv-4-address: '1.1.4.4' + subscribing-application-port: 4004 + notifications-receiving-operation: '/v1/regard-device-object-deletion' + responses: + '204': + description: 'Subscription for notifications about object deletions at the devices created' ######################################################################################################################## # Common Components diff --git a/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+data.completeness.json b/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+data.completeness.json index 96a137d..b1cb267 100644 --- a/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+data.completeness.json +++ b/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+data.completeness.json @@ -33,15 +33,13 @@ ], "collectionInputList": [ { - "collectionName": "nep", + "collectionName": "np.completeness", "serverToBeApplied": "NotificationProxy", - "mountName": "513250011", "kindOfReference": "dynamic" }, { - "collectionName": "nep_simulator", + "collectionName": "np_simulator.completeness", "serverToBeApplied": "NotificationProxy+simu", - "mountName": "513250010", "kindOfReference": "static", "suffixUrlEncodingIsRequired": true } diff --git a/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+test.completeness.json b/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+test.completeness.json index 8b68f79..a225a4f 100644 --- a/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+test.completeness.json +++ b/testing/2_functional/completeness/v1.1.0/testcases/NetExplorerProxy+test.completeness.json @@ -1 +1,2862 @@ -#todo \ No newline at end of file +{ + "info": { + "name": "NotificationProxy_1.1.0+test.completeness", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "UserInput", + "item": [ + { + "name": "for loading user input", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "console.clear();\r", + "logger.struc(\"==========================================================================================\");\r", + "logger.struc(\"===== NotificationProxy+test.completeness ===================================================\");\r", + "logger.struc(\"==========================================================================================\");\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data from File\r", + "****************************************************************************************/\r", + "var inputFromFile;\r", + "try {\r", + " inputFromFile = data\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Environmental Variables \r", + "****************************************************************************************/\r", + "try {\r", + " pm.environment.clear();\r", + "\r", + " let mode;\r", + " mode = inputFromFile.mode;\r", + " // Mode to be applied while running this testcase collection \r", + " // \"analysis\" -> human does detailed analysis of response bodies etc.\r", + " // \"testing\" -> automated approval based on binary result\r", + " // \"debugging\" -> support for programming the testcase collection\r", + "\r", + " let logLevel;\r", + " switch(mode) {\r", + " case \"debugging\":\r", + " logLevel = \"debug\";\r", + " break;\r", + " case \"analysis\":\r", + " logLevel = \"log\";\r", + " break;\r", + " case \"testing\":\r", + " logLevel = \"error\";\r", + " break;\r", + " default:\r", + " logLevel = \"debug\";\r", + " };\r", + " // Level of detail of the logging; find more info in pre-request script on the collection's level\r", + "\r", + " let serverList = [];\r", + " serverList = inputFromFile.serverList;\r", + " // list of addresses of applications, controllers etc.\r", + " // serverName : key attribute for identifying the servers\r", + " // dummyUri : http address that shall be addressed by bare processing Requests\r", + " // server : part of the URI that is comprised from protocol, IP address and TCP port\r", + " // pathToControlConstruct : part of the URI that is identical for all Requests that are addressing into the device's data tree\r", + " // authorizationCode : authentication that has to be sent in case of BasicAuth protection (e.g. OpenDaylight NBI)\r", + " // operationKey : ApiKey that has to be sent in case of addressing a MW SDN application (e.g. MicroWaveDeviceInventory)\r", + " // userName : user header to be sent in case of addressing a MW SDN application\r", + " // originator : originator header to be sent in case of addressing a MW SDN application\r", + " // xCorrelator : x-correlator header to be sent in case of addressing a MW SDN application\r", + " // traceIndicator : trace-indicator header to be sent in case of addressing a MW SDN application\r", + " // customerJourney : customer-journey header to be sent in case of addressing a MW SDN application\r", + "\r", + " let collectionInputList = [];\r", + " collectionInputList = inputFromFile.collectionInputList;\r", + " // list of inputs to individual test case collections\r", + " // serverToBeApplied : server that shall be addressed in the respective request/test case\r", + " // mountName : mountName of the device that is to be validated\r", + " // linkId : Telefonica LinkID of an example microwave link\r", + " // kindOfReference : 'dynamic' for testing against implementations, 'static' for testing against simulators\r", + " // suffixUrlEncodingIsRequired : e.g. Mockoon requires the suffix being url encoded, but applications vice versa\r", + "\r", + " pm.environment.set(\"mode\", mode);\r", + " pm.environment.set(\"logLevel\", logLevel);\r", + " pm.environment.set(\"serverList\", serverList);\r", + " pm.environment.set(\"collectionInputList\", collectionInputList);\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Environment variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Collection Variables \r", + "****************************************************************************************/\r", + "try {\r", + " pm.collectionVariables.clear()\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Collection variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let uri;\r", + " let dummyServerInfo;\r", + " dummyServerInfo = ExtractServerInformation(inputFromFile.serverList, \"dummy\");\r", + " uri = dummyServerInfo.dummyUri;\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i\",\r\n \"subscribing-application-release\": \"28.5.7\",\r\n \"subscribing-application-protocol\": \"HTTPS\",\r\n \"subscribing-application-address\": {\r\n \"ip-address\": {\r\n \"ipv-4-address\": \"127.0.0.1\"\r\n }\r\n },\r\n \"subscribing-application-port\": 12345,\r\n \"notifications-receiving-operation\": \"/v1/regard-controller-attribute-value-change\"\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{uri}}", + "host": [ + "{{uri}}" + ] + } + }, + "response": [] + }, + { + "name": "/v1/notify-controller-object-creations", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var uri;\r", + "var dummyUri;\r", + "var operationName;\r", + "try {\r", + " uri = pm.variables.get(\"uri\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let dummyServerInfo;\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\");\r", + " dummyUri = dummyServerInfo.dummyUri;\r", + "\r", + " operationName = pm.collectionVariables.get(\"operationName\");\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Extracting Result\r", + "****************************************************************************************/\r", + "var responseCode;\r", + "var responseObject = {};\r", + "try {\r", + " if (uri != dummyUri) {\r", + " let response;\r", + " response = pm.response;\r", + "\r", + " responseCode = parseInt(response.code);\r", + "\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! result could not be extracted.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "try {\r", + " if (uri != dummyUri) {\r", + " logger.log(\"Analysis:\");\r", + "\r", + " pm.test(operationName + \" could be executed\", function () {\r", + " pm.expect(responseCode).to.equal(204)\r", + " });\r", + " if (responseCode == 204) {\r", + " logger.log(\" - ok: \" + operationName + \" could be executed\")\r", + " } else {\r", + " logger.log(\" - FAIL: \" + operationName + \" \" + responseCode + \" instead of 204\")\r", + " }\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! validation could not be completely executed.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Collection Variables\r", + "****************************************************************************************/\r", + "try {\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! collection variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for (let i = 0; i < serverList.length; i++) {\r", + " if (serverList[i].serverName == searchedServerName) {\r", + " return serverList[i]\r", + " }\r", + " }\r", + " } catch (error) {\r", + " logger.error(\"! serverList not found or faulty\");\r", + " return {}\r", + " }\r", + " logger.warn(\"Server could not be found in serverList.\");\r", + " return {}\r", + "}\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var operationName = \"/v1/notify-controller-object-creations\";\r", + "pm.collectionVariables.set(\"operationName\", operationName);\r", + "\r", + "logger.struc(\"\\n===== \" + operationName + \" ================================================\");\r", + "\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var mountName = \"\";\r", + "var serverInfo = {};\r", + "var dummyServerInfo = {};\r", + "try {\r", + " let collectionInfo;\r", + " let collectionInputList;\r", + " collectionInputList = pm.environment.get(\"collectionInputList\");\r", + " collectionInfo = ExtractCollectionInput(collectionInputList, \"np.completeness\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let serverToBeApplied;\r", + " serverToBeApplied = collectionInfo.serverToBeApplied;\r", + " serverInfo = ExtractServerInformation(serverList, serverToBeApplied);\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\")\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let servicePath;\r", + " servicePath = operationName;\r", + "\r", + " let server;\r", + " server = serverInfo.server;\r", + "\r", + " let uri = server + servicePath;\r", + "\r", + " /*\r", + " let requestBody;\r", + " requestBody = '{}';\r", + " */\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + " //pm.variables.set(\"requestBody\", requestBody);\r", + " \r", + " pm.request.headers.upsert({ key: \"Authorization\", value: serverInfo.authorizationCode });\r", + " pm.request.headers.upsert({ key: \"operation-key\", value: serverInfo.operationKey });\r", + " pm.request.headers.upsert({ key: \"user\", value: serverInfo.userName });\r", + " pm.request.headers.upsert({ key: \"originator\", value: serverInfo.originator });\r", + " pm.request.headers.upsert({ key: \"x-correlator\", value: serverInfo.xCorrelator });\r", + " pm.request.headers.upsert({ key: \"trace-indicator\", value: serverInfo.traceIndicator });\r", + " pm.request.headers.upsert({ key: \"customer-journey\", value: serverInfo.customerJourney });\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i\",\r\n \"subscribing-application-release\": \"28.5.7\",\r\n \"subscribing-application-protocol\": \"HTTPS\",\r\n \"subscribing-application-address\": {\r\n \"ip-address\": {\r\n \"ipv-4-address\": \"127.0.0.1\"\r\n }\r\n },\r\n \"subscribing-application-port\": 12345,\r\n \"notifications-receiving-operation\": \"/v1/regard-controller-object-creation\"\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{uri}}", + "host": [ + "{{uri}}" + ] + } + }, + "response": [] + }, + { + "name": "/v1/notify-controller-object-deletions", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var uri;\r", + "var dummyUri;\r", + "var operationName;\r", + "try {\r", + " uri = pm.variables.get(\"uri\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let dummyServerInfo;\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\");\r", + " dummyUri = dummyServerInfo.dummyUri;\r", + "\r", + " operationName = pm.collectionVariables.get(\"operationName\");\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Extracting Result\r", + "****************************************************************************************/\r", + "var responseCode;\r", + "var responseObject = {};\r", + "try {\r", + " if (uri != dummyUri) {\r", + " let response;\r", + " response = pm.response;\r", + "\r", + " responseCode = parseInt(response.code);\r", + "\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! result could not be extracted.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "try {\r", + " if (uri != dummyUri) {\r", + " logger.log(\"Analysis:\");\r", + "\r", + " pm.test(operationName + \" could be executed\", function () {\r", + " pm.expect(responseCode).to.equal(204)\r", + " });\r", + " if (responseCode == 204) {\r", + " logger.log(\" - ok: \" + operationName + \" could be executed\")\r", + " } else {\r", + " logger.log(\" - FAIL: \" + operationName + \" \" + responseCode + \" instead of 204\")\r", + " }\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! validation could not be completely executed.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Collection Variables\r", + "****************************************************************************************/\r", + "try {\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! collection variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for (let i = 0; i < serverList.length; i++) {\r", + " if (serverList[i].serverName == searchedServerName) {\r", + " return serverList[i]\r", + " }\r", + " }\r", + " } catch (error) {\r", + " logger.error(\"! serverList not found or faulty\");\r", + " return {}\r", + " }\r", + " logger.warn(\"Server could not be found in serverList.\");\r", + " return {}\r", + "}\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var operationName = \"/v1/notify-controller-object-deletions\";\r", + "pm.collectionVariables.set(\"operationName\", operationName);\r", + "\r", + "logger.struc(\"\\n===== \" + operationName + \" ================================================\");\r", + "\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var mountName = \"\";\r", + "var serverInfo = {};\r", + "var dummyServerInfo = {};\r", + "try {\r", + " let collectionInfo;\r", + " let collectionInputList;\r", + " collectionInputList = pm.environment.get(\"collectionInputList\");\r", + " collectionInfo = ExtractCollectionInput(collectionInputList, \"np.completeness\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let serverToBeApplied;\r", + " serverToBeApplied = collectionInfo.serverToBeApplied;\r", + " serverInfo = ExtractServerInformation(serverList, serverToBeApplied);\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\")\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let servicePath;\r", + " servicePath = operationName;\r", + "\r", + " let server;\r", + " server = serverInfo.server;\r", + "\r", + " let uri = server + servicePath;\r", + "\r", + " /*\r", + " let requestBody;\r", + " requestBody = '{}';\r", + " */\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + " //pm.variables.set(\"requestBody\", requestBody);\r", + " \r", + " pm.request.headers.upsert({ key: \"Authorization\", value: serverInfo.authorizationCode });\r", + " pm.request.headers.upsert({ key: \"operation-key\", value: serverInfo.operationKey });\r", + " pm.request.headers.upsert({ key: \"user\", value: serverInfo.userName });\r", + " pm.request.headers.upsert({ key: \"originator\", value: serverInfo.originator });\r", + " pm.request.headers.upsert({ key: \"x-correlator\", value: serverInfo.xCorrelator });\r", + " pm.request.headers.upsert({ key: \"trace-indicator\", value: serverInfo.traceIndicator });\r", + " pm.request.headers.upsert({ key: \"customer-journey\", value: serverInfo.customerJourney });\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i\",\r\n \"subscribing-application-release\": \"28.5.7\",\r\n \"subscribing-application-protocol\": \"HTTPS\",\r\n \"subscribing-application-address\": {\r\n \"ip-address\": {\r\n \"ipv-4-address\": \"127.0.0.1\"\r\n }\r\n },\r\n \"subscribing-application-port\": 12345,\r\n \"notifications-receiving-operation\": \"/v1/regard-controller-object-deletion\"\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{uri}}", + "host": [ + "{{uri}}" + ] + } + }, + "response": [] + }, + { + "name": "/v1/notify-device-alarms", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var uri;\r", + "var dummyUri;\r", + "var operationName;\r", + "try {\r", + " uri = pm.variables.get(\"uri\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let dummyServerInfo;\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\");\r", + " dummyUri = dummyServerInfo.dummyUri;\r", + "\r", + " operationName = pm.collectionVariables.get(\"operationName\");\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Extracting Result\r", + "****************************************************************************************/\r", + "var responseCode;\r", + "var responseObject = {};\r", + "try {\r", + " if (uri != dummyUri) {\r", + " let response;\r", + " response = pm.response;\r", + "\r", + " responseCode = parseInt(response.code);\r", + "\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! result could not be extracted.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "try {\r", + " if (uri != dummyUri) {\r", + " logger.log(\"Analysis:\");\r", + "\r", + " pm.test(operationName + \" could be executed\", function () {\r", + " pm.expect(responseCode).to.equal(204)\r", + " });\r", + " if (responseCode == 204) {\r", + " logger.log(\" - ok: \" + operationName + \" could be executed\")\r", + " } else {\r", + " logger.log(\" - FAIL: \" + operationName + \" \" + responseCode + \" instead of 204\")\r", + " }\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! validation could not be completely executed.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Collection Variables\r", + "****************************************************************************************/\r", + "try {\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! collection variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for (let i = 0; i < serverList.length; i++) {\r", + " if (serverList[i].serverName == searchedServerName) {\r", + " return serverList[i]\r", + " }\r", + " }\r", + " } catch (error) {\r", + " logger.error(\"! serverList not found or faulty\");\r", + " return {}\r", + " }\r", + " logger.warn(\"Server could not be found in serverList.\");\r", + " return {}\r", + "}\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var operationName = \"/v1/notify-device-alarms\";\r", + "pm.collectionVariables.set(\"operationName\", operationName);\r", + "\r", + "logger.struc(\"\\n===== \" + operationName + \" ================================================\");\r", + "\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var mountName = \"\";\r", + "var serverInfo = {};\r", + "var dummyServerInfo = {};\r", + "try {\r", + " let collectionInfo;\r", + " let collectionInputList;\r", + " collectionInputList = pm.environment.get(\"collectionInputList\");\r", + " collectionInfo = ExtractCollectionInput(collectionInputList, \"np.completeness\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let serverToBeApplied;\r", + " serverToBeApplied = collectionInfo.serverToBeApplied;\r", + " serverInfo = ExtractServerInformation(serverList, serverToBeApplied);\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\")\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let servicePath;\r", + " servicePath = operationName;\r", + "\r", + " let server;\r", + " server = serverInfo.server;\r", + "\r", + " let uri = server + servicePath;\r", + "\r", + " /*\r", + " let requestBody;\r", + " requestBody = '{}';\r", + " */\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + " //pm.variables.set(\"requestBody\", requestBody);\r", + " \r", + " pm.request.headers.upsert({ key: \"Authorization\", value: serverInfo.authorizationCode });\r", + " pm.request.headers.upsert({ key: \"operation-key\", value: serverInfo.operationKey });\r", + " pm.request.headers.upsert({ key: \"user\", value: serverInfo.userName });\r", + " pm.request.headers.upsert({ key: \"originator\", value: serverInfo.originator });\r", + " pm.request.headers.upsert({ key: \"x-correlator\", value: serverInfo.xCorrelator });\r", + " pm.request.headers.upsert({ key: \"trace-indicator\", value: serverInfo.traceIndicator });\r", + " pm.request.headers.upsert({ key: \"customer-journey\", value: serverInfo.customerJourney });\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i\",\r\n \"subscribing-application-release\": \"3.0.8\",\r\n \"subscribing-application-protocol\": \"HTTP\",\r\n \"subscribing-application-address\": {\r\n \"ip-address\": {\r\n \"ipv-4-address\": \"127.0.0.1\"\r\n }\r\n },\r\n \"subscribing-application-port\": 12345,\r\n \"notifications-receiving-operation\": \"/v1/regard-device-alarm\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{uri}}", + "host": [ + "{{uri}}" + ] + } + }, + "response": [] + }, + { + "name": "/v1/notify-device-attribute-value-changes", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var uri;\r", + "var dummyUri;\r", + "var operationName;\r", + "try {\r", + " uri = pm.variables.get(\"uri\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let dummyServerInfo;\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\");\r", + " dummyUri = dummyServerInfo.dummyUri;\r", + "\r", + " operationName = pm.collectionVariables.get(\"operationName\");\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Extracting Result\r", + "****************************************************************************************/\r", + "var responseCode;\r", + "var responseObject = {};\r", + "try {\r", + " if (uri != dummyUri) {\r", + " let response;\r", + " response = pm.response;\r", + "\r", + " responseCode = parseInt(response.code);\r", + "\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! result could not be extracted.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "try {\r", + " if (uri != dummyUri) {\r", + " logger.log(\"Analysis:\");\r", + "\r", + " pm.test(operationName + \" could be executed\", function () {\r", + " pm.expect(responseCode).to.equal(204)\r", + " });\r", + " if (responseCode == 204) {\r", + " logger.log(\" - ok: \" + operationName + \" could be executed\")\r", + " } else {\r", + " logger.log(\" - FAIL: \" + operationName + \" \" + responseCode + \" instead of 204\")\r", + " }\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! validation could not be completely executed.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Collection Variables\r", + "****************************************************************************************/\r", + "try {\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! collection variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for (let i = 0; i < serverList.length; i++) {\r", + " if (serverList[i].serverName == searchedServerName) {\r", + " return serverList[i]\r", + " }\r", + " }\r", + " } catch (error) {\r", + " logger.error(\"! serverList not found or faulty\");\r", + " return {}\r", + " }\r", + " logger.warn(\"Server could not be found in serverList.\");\r", + " return {}\r", + "}\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var operationName = \"/v1/notify-device-attribute-value-changes\";\r", + "pm.collectionVariables.set(\"operationName\", operationName);\r", + "\r", + "logger.struc(\"\\n===== \" + operationName + \" ================================================\");\r", + "\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var mountName = \"\";\r", + "var serverInfo = {};\r", + "var dummyServerInfo = {};\r", + "try {\r", + " let collectionInfo;\r", + " let collectionInputList;\r", + " collectionInputList = pm.environment.get(\"collectionInputList\");\r", + " collectionInfo = ExtractCollectionInput(collectionInputList, \"np.completeness\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let serverToBeApplied;\r", + " serverToBeApplied = collectionInfo.serverToBeApplied;\r", + " serverInfo = ExtractServerInformation(serverList, serverToBeApplied);\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\")\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let servicePath;\r", + " servicePath = operationName;\r", + "\r", + " let server;\r", + " server = serverInfo.server;\r", + "\r", + " let uri = server + servicePath;\r", + "\r", + " /*\r", + " let requestBody;\r", + " requestBody = '{}';\r", + " */\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + " //pm.variables.set(\"requestBody\", requestBody);\r", + " \r", + " pm.request.headers.upsert({ key: \"Authorization\", value: serverInfo.authorizationCode });\r", + " pm.request.headers.upsert({ key: \"operation-key\", value: serverInfo.operationKey });\r", + " pm.request.headers.upsert({ key: \"user\", value: serverInfo.userName });\r", + " pm.request.headers.upsert({ key: \"originator\", value: serverInfo.originator });\r", + " pm.request.headers.upsert({ key: \"x-correlator\", value: serverInfo.xCorrelator });\r", + " pm.request.headers.upsert({ key: \"trace-indicator\", value: serverInfo.traceIndicator });\r", + " pm.request.headers.upsert({ key: \"customer-journey\", value: serverInfo.customerJourney });\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i\",\r\n \"subscribing-application-release\": \"3.0.8\",\r\n \"subscribing-application-protocol\": \"HTTP\",\r\n \"subscribing-application-address\": {\r\n \"ip-address\": {\r\n \"ipv-4-address\": \"127.0.0.1\"\r\n }\r\n },\r\n \"subscribing-application-port\": 12345,\r\n \"notifications-receiving-operation\": \"/v1/regard-device-attribute-value-change\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{uri}}", + "host": [ + "{{uri}}" + ] + } + }, + "response": [] + }, + { + "name": "/v1/notify-device-object-creations", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var uri;\r", + "var dummyUri;\r", + "var operationName;\r", + "try {\r", + " uri = pm.variables.get(\"uri\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let dummyServerInfo;\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\");\r", + " dummyUri = dummyServerInfo.dummyUri;\r", + "\r", + " operationName = pm.collectionVariables.get(\"operationName\");\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Extracting Result\r", + "****************************************************************************************/\r", + "var responseCode;\r", + "var responseObject = {};\r", + "try {\r", + " if (uri != dummyUri) {\r", + " let response;\r", + " response = pm.response;\r", + "\r", + " responseCode = parseInt(response.code);\r", + "\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! result could not be extracted.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "try {\r", + " if (uri != dummyUri) {\r", + " logger.log(\"Analysis:\");\r", + "\r", + " pm.test(operationName + \" could be executed\", function () {\r", + " pm.expect(responseCode).to.equal(204)\r", + " });\r", + " if (responseCode == 204) {\r", + " logger.log(\" - ok: \" + operationName + \" could be executed\")\r", + " } else {\r", + " logger.log(\" - FAIL: \" + operationName + \" \" + responseCode + \" instead of 204\")\r", + " }\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! validation could not be completely executed.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Collection Variables\r", + "****************************************************************************************/\r", + "try {\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! collection variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for (let i = 0; i < serverList.length; i++) {\r", + " if (serverList[i].serverName == searchedServerName) {\r", + " return serverList[i]\r", + " }\r", + " }\r", + " } catch (error) {\r", + " logger.error(\"! serverList not found or faulty\");\r", + " return {}\r", + " }\r", + " logger.warn(\"Server could not be found in serverList.\");\r", + " return {}\r", + "}\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var operationName = \"/v1/notify-device-object-creations\";\r", + "pm.collectionVariables.set(\"operationName\", operationName);\r", + "\r", + "logger.struc(\"\\n===== \" + operationName + \" ================================================\");\r", + "\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var mountName = \"\";\r", + "var serverInfo = {};\r", + "var dummyServerInfo = {};\r", + "try {\r", + " let collectionInfo;\r", + " let collectionInputList;\r", + " collectionInputList = pm.environment.get(\"collectionInputList\");\r", + " collectionInfo = ExtractCollectionInput(collectionInputList, \"np.completeness\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let serverToBeApplied;\r", + " serverToBeApplied = collectionInfo.serverToBeApplied;\r", + " serverInfo = ExtractServerInformation(serverList, serverToBeApplied);\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\")\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let servicePath;\r", + " servicePath = operationName;\r", + "\r", + " let server;\r", + " server = serverInfo.server;\r", + "\r", + " let uri = server + servicePath;\r", + "\r", + " /*\r", + " let requestBody;\r", + " requestBody = '{}';\r", + " */\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + " //pm.variables.set(\"requestBody\", requestBody);\r", + " \r", + " pm.request.headers.upsert({ key: \"Authorization\", value: serverInfo.authorizationCode });\r", + " pm.request.headers.upsert({ key: \"operation-key\", value: serverInfo.operationKey });\r", + " pm.request.headers.upsert({ key: \"user\", value: serverInfo.userName });\r", + " pm.request.headers.upsert({ key: \"originator\", value: serverInfo.originator });\r", + " pm.request.headers.upsert({ key: \"x-correlator\", value: serverInfo.xCorrelator });\r", + " pm.request.headers.upsert({ key: \"trace-indicator\", value: serverInfo.traceIndicator });\r", + " pm.request.headers.upsert({ key: \"customer-journey\", value: serverInfo.customerJourney });\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i\",\r\n \"subscribing-application-release\": \"3.0.8\",\r\n \"subscribing-application-protocol\": \"HTTP\",\r\n \"subscribing-application-address\": {\r\n \"ip-address\": {\r\n \"ipv-4-address\": \"127.0.0.1\"\r\n }\r\n },\r\n \"subscribing-application-port\": 12345,\r\n \"notifications-receiving-operation\": \"/v1/regard-device-object-creation\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{uri}}", + "host": [ + "{{uri}}" + ] + } + }, + "response": [] + }, + { + "name": "/v1/notify-device-object-deletions", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var uri;\r", + "var dummyUri;\r", + "var operationName;\r", + "try {\r", + " uri = pm.variables.get(\"uri\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let dummyServerInfo;\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\");\r", + " dummyUri = dummyServerInfo.dummyUri;\r", + "\r", + " operationName = pm.collectionVariables.get(\"operationName\");\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Extracting Result\r", + "****************************************************************************************/\r", + "var responseCode;\r", + "var responseObject = {};\r", + "try {\r", + " if (uri != dummyUri) {\r", + " let response;\r", + " response = pm.response;\r", + "\r", + " responseCode = parseInt(response.code);\r", + "\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! result could not be extracted.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "try {\r", + " if (uri != dummyUri) {\r", + " logger.log(\"Analysis:\");\r", + "\r", + " pm.test(operationName + \" could be executed\", function () {\r", + " pm.expect(responseCode).to.equal(204)\r", + " });\r", + " if (responseCode == 204) {\r", + " logger.log(\" - ok: \" + operationName + \" could be executed\")\r", + " } else {\r", + " logger.log(\" - FAIL: \" + operationName + \" \" + responseCode + \" instead of 204\")\r", + " }\r", + " }\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! validation could not be completely executed.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Collection Variables\r", + "****************************************************************************************/\r", + "try {\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! collection variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for (let i = 0; i < serverList.length; i++) {\r", + " if (serverList[i].serverName == searchedServerName) {\r", + " return serverList[i]\r", + " }\r", + " }\r", + " } catch (error) {\r", + " logger.error(\"! serverList not found or faulty\");\r", + " return {}\r", + " }\r", + " logger.warn(\"Server could not be found in serverList.\");\r", + " return {}\r", + "}\r", + "\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var operationName = \"/v1/notify-device-object-deletions\";\r", + "pm.collectionVariables.set(\"operationName\", operationName);\r", + "\r", + "logger.struc(\"\\n===== \" + operationName + \" ================================================\");\r", + "\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var mountName = \"\";\r", + "var serverInfo = {};\r", + "var dummyServerInfo = {};\r", + "try {\r", + " let collectionInfo;\r", + " let collectionInputList;\r", + " collectionInputList = pm.environment.get(\"collectionInputList\");\r", + " collectionInfo = ExtractCollectionInput(collectionInputList, \"np.completeness\");\r", + "\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " let serverToBeApplied;\r", + " serverToBeApplied = collectionInfo.serverToBeApplied;\r", + " serverInfo = ExtractServerInformation(serverList, serverToBeApplied);\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\")\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let servicePath;\r", + " servicePath = operationName;\r", + "\r", + " let server;\r", + " server = serverInfo.server;\r", + "\r", + " let uri = server + servicePath;\r", + "\r", + " /*\r", + " let requestBody;\r", + " requestBody = '{}';\r", + " */\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + " //pm.variables.set(\"requestBody\", requestBody);\r", + " \r", + " pm.request.headers.upsert({ key: \"Authorization\", value: serverInfo.authorizationCode });\r", + " pm.request.headers.upsert({ key: \"operation-key\", value: serverInfo.operationKey });\r", + " pm.request.headers.upsert({ key: \"user\", value: serverInfo.userName });\r", + " pm.request.headers.upsert({ key: \"originator\", value: serverInfo.originator });\r", + " pm.request.headers.upsert({ key: \"x-correlator\", value: serverInfo.xCorrelator });\r", + " pm.request.headers.upsert({ key: \"trace-indicator\", value: serverInfo.traceIndicator });\r", + " pm.request.headers.upsert({ key: \"customer-journey\", value: serverInfo.customerJourney });\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i\",\r\n \"subscribing-application-release\": \"3.0.8\",\r\n \"subscribing-application-protocol\": \"HTTP\",\r\n \"subscribing-application-address\": {\r\n \"ip-address\": {\r\n \"ipv-4-address\": \"127.0.0.1\"\r\n }\r\n },\r\n \"subscribing-application-port\": 12345,\r\n \"notifications-receiving-operation\": \"/v1/regard-device-object-deletion\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{uri}}", + "host": [ + "{{uri}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Termination", + "item": [ + { + "name": "Clearing collection data", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "logger.struc(\"\\n===== Clearing collection data ============================================================\");\r", + "\r", + "/****************************************************************************************\r", + "* Loading Input Data\r", + "****************************************************************************************/\r", + "var dummyServerInfo;\r", + "try {\r", + " let serverList;\r", + " serverList = pm.environment.get(\"serverList\");\r", + " dummyServerInfo = ExtractServerInformation(serverList, \"dummy\")\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Input data could not be loaded.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Processing\r", + "****************************************************************************************/\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Setting Local Variables and Preparing the Request\r", + "****************************************************************************************/\r", + "try {\r", + " let uri;\r", + " uri = dummyServerInfo.dummyUri;\r", + "\r", + " pm.variables.clear();\r", + "\r", + " pm.variables.set(\"uri\", uri);\r", + "\r", + " pm.request.headers.upsert({ key: \"Accept\", value: \"application/json\" });\r", + " pm.request.headers.upsert({ key: \"Content-Type\", value: \"application/json\" })\r", + "\r", + "} catch (error) {\r", + " logger.error(\"! Local variables could not be set.\")\r", + "}\r", + "\r", + "\r", + "/****************************************************************************************\r", + "* Functions\r", + "****************************************************************************************/\r", + "function ExtractServerInformation(serverList, searchedServerName) {\r", + " try {\r", + " for(let i=0; i log -> info -> warn -> error -> struc -> none", + "// It creates \"logger\" global variable which can be used anywhere in nested collection scripts", + "", + "const logLevels = [\"debug\", \"log\", \"info\", \"warn\", \"error\", \"struc\", \"none\"];", + "", + "const shouldLog = (level) => {", + " return logLevels.indexOf(level) >= logLevels.indexOf(pm.environment.get(\"logLevel\"));", + "};", + "", + "logger = {", + " debug: (message, ...optionalParams) => {", + " shouldLog(\"debug\") && console.log(message, ...optionalParams);", + " },", + " log: (message, ...optionalParams) => {", + " shouldLog(\"log\") && console.log(message, ...optionalParams);", + " },", + " info: (message, ...optionalParams) => {", + " shouldLog(\"info\") && console.log(message, ...optionalParams);", + " },", + " warn: (message, ...optionalParams) => {", + " shouldLog(\"warn\") && console.log(message, ...optionalParams);", + " },", + " error: (message, ...optionalParams) => {", + " shouldLog(\"error\") && console.error(message, ...optionalParams);", + " },", + " struc: (message, ...optionalParams) => {", + " shouldLog(\"error\") && console.log(message, ...optionalParams);", + " },", + "};", + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file