Add Metadata tests for PM Mapper

Change-Id: I6f0904e1b3e10fd1c9fe41020898380e1fb50141
Issue-ID: INT-863
Signed-off-by: JoeOLeary <joseph.o.leary@est.tech>
diff --git a/tests/dcaegen2-pmmapper/pmmapper/__init__.robot b/tests/dcaegen2-pmmapper/pmmapper/__init__.robot
index 7114fd4..3e4501c 100644
--- a/tests/dcaegen2-pmmapper/pmmapper/__init__.robot
+++ b/tests/dcaegen2-pmmapper/pmmapper/__init__.robot
@@ -1,2 +1,2 @@
 *** Settings ***
-Documentation    5G Bulk PM E2E Testcases
+Documentation    PM Mapper Testcases
diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
index 1e3d9e9..a05defb 100644
--- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
+++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
@@ -5,10 +5,15 @@
 Library           RequestsLibrary
 Library           Process
 
+Test Setup        Create Session  mapper_session  ${PMMAPPER_BASE_URL}
+Test Teardown     Delete All Sessions
+
 
 *** Variables ***
 ${CLI_EXEC_CLI_CONFIG}                   { head -n 5 | tail -1;} < /tmp/pmmapper.log
 ${CLI_EXEC_CLI_SUBS}                     curl -k https://${DR_PROV_IP}:8443/internal/prov
+${PMMAPPER_BASE_URL}                     http://${PMMAPPER_IP}:8081
+${DELIVERY_ENDPOINT}                     /delivery
 
 *** Test Cases ***
 
@@ -28,6 +33,24 @@
     Should Be Equal As Strings      ${cli_cmd_output.rc}            0
     Should Contain                  ${cli_cmd_output.stdout}        3gpppmmapper
 
+Verify 3GPP PM Mapper responds appropriately when no metadata is provided
+    [Tags]                          PM_MAPPER_10
+    [Documentation]                 Verify 3GPP PM Mapper responds 400 with the message "Missing Metadata." when no metadata is provided
+    [Timeout]                       1 minute
+    ${headers}=                     Create Dictionary               X-ONAP-RequestID=1  Content-Type=application/xml
+    ${resp}=                        Put Request                     mapper_session  ${DELIVERY_ENDPOINT}    data='${EMPTY}'    headers=${headers}
+    Should Be Equal As Strings      ${resp.status_code}             400
+    Should Be Equal As Strings      ${resp.content}                 Missing Metadata.
+
+Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided
+    [Tags]                          PM_MAPPER_11
+    [Documentation]                 Verify 3GPP PM Mapper responds 400 with the message "Malformed Metadata." when invalid metadata is provided
+    [Timeout]                       1 minute
+    ${headers}=                     Create Dictionary               X-ONAP-RequestID=1  X-ATT-DR-META='not metadata'  Content-Type=application/xml
+    ${resp}=                        Put Request                     mapper_session  ${DELIVERY_ENDPOINT}  data='${EMPTY}'  headers=${headers}
+    Should Be Equal As Strings      ${resp.status_code}             400
+    Should Be Equal As Strings      ${resp.content}                 Malformed Metadata.
+
 *** Keywords ***
 
 PostCall