From 86fabf65c621914e38458d5362c78f9bce79c3a9 Mon Sep 17 00:00:00 2001 From: mprzybys Date: Tue, 18 Feb 2020 13:33:33 +0000 Subject: Add test case for empty json body send to vesListener API Issue-ID: INT-1448 Signed-off-by: Marcin Przybysz Change-Id: Ic5b5c7fc19c733fe60eb9ab31a870c9b3446d6fb --- .../json_events/ves7_missing_mandatory_domain.json | 33 ---------------------- .../ves7_missing_mandatory_parameter.json | 33 ++++++++++++++++++++++ .../assets/json_events/ves_empty_json.json | 1 + tests/dcaegen2/testcases/dcae_ves.robot | 9 ++++-- .../testcases/resources/dcae_properties.robot | 3 +- 5 files changed, 43 insertions(+), 36 deletions(-) delete mode 100644 tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json create mode 100644 tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_parameter.json create mode 100644 tests/dcaegen2/testcases/assets/json_events/ves_empty_json.json diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json b/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json deleted file mode 100644 index 51787555..00000000 --- a/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "vesEventListenerVersion": "7.0.1", - "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "sequence": 1, - "priority": "High", - "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", - "reportingEntityName": "ibcx0001vm002oam001", - "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", - "sourceName": "scfx0001vm002cap001", - "nfVendorName": "Ericsson", - "nfNamingCode": "scfx", - "nfcNamingCode": "ssc", - "startEpochMicrosec": 1413378172000000, - "lastEpochMicrosec": 1413378172000000, - "timeZoneOffset": "UTC-05:30" - }, - "faultFields": { - "faultFieldsVersion": "4.0", - "alarmCondition": "PilotNumberPoolExhaustion", - "eventSourceType": "other", - "specificProblem": "Calls cannot complete - pilot numbers are unavailable", - "eventSeverity": "CRITICAL", - "vfStatus": "Active", - "alarmAdditionalInformation": { - "PilotNumberPoolSize": "1000" - } - } - } -} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_parameter.json b/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_parameter.json new file mode 100644 index 00000000..60d31955 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_parameter.json @@ -0,0 +1,33 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "PilotNumberPoolExhaustion", + "eventSourceType": "other", + "specificProblem": "Calls cannot complete - pilot numbers are unavailable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "PilotNumberPoolSize": "1000" + } + } + } +} \ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_empty_json.json b/tests/dcaegen2/testcases/assets/json_events/ves_empty_json.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_empty_json.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/dcaegen2/testcases/dcae_ves.robot b/tests/dcaegen2/testcases/dcae_ves.robot index e12097e2..c1635758 100644 --- a/tests/dcaegen2/testcases/dcae_ves.robot +++ b/tests/dcaegen2/testcases/dcae_ves.robot @@ -31,10 +31,15 @@ Publish Single VES VNF Measurement Event with wrong JSON [Documentation] Post single event with invalid data to /eventListener/v7 endpoint and expect 400 Response Status Code Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_INVALID_JSON_V7} 400 -Publish Single VES VNF Measurement Event with missing mandatory parameter domain +Publish Single VES VNF Measurement Event with missing mandatory parameter [Tags] DCAE-VESC-R1 [Documentation] Post single event with lack of one of the mandatory parameters "domain" to /eventListener/v7 endpoint and expect 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_MISSING_MANDATORY_DOMAIN_V7} 400 + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_MISSING_MANDATORY_PARAMETER_V7} 400 + +Publish Single VES VNF Measurement Event with empty json + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with empty json to /eventListener/v7 endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_EMPTY_JSON} 400 Publish Single VES VNF Measurement Event with No Auth over HTTPS [Tags] DCAE-VESC-R1 diff --git a/tests/dcaegen2/testcases/resources/dcae_properties.robot b/tests/dcaegen2/testcases/resources/dcae_properties.robot index 5262330b..f287ba69 100644 --- a/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -31,7 +31,8 @@ ${VES_EVENTLISTENER_V7} /eventListener/v7 ${VES_BATCH_EVENT_ENDPOINT_V7} /eventListener/v7/eventBatch ${VES_VALID_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid.json ${VES_INVALID_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_invalid.json -${VES_MISSING_MANDATORY_DOMAIN_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json +${VES_MISSING_MANDATORY_PARAMETER_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_parameter.json +${VES_EMPTY_JSON} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_empty_json.json ${VES_VALID_BATCH_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_batch_valid.json ${EVENT_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event.json ${EVENT_MEASURE_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_vfirewall_measurement.json -- cgit 1.2.3-korg