Use ONAPLibrary.SDC in SDC-DCAE-DS communication

 Refactor SDC-DCAE-DS CSIT further by taking ONAPLibrary.SDC
 in use also for communications with SDC-DCAE-DS

Issue-ID: TEST-186
Signed-off-by: kaihlavi <l.kaihlavirt@partner.samsung.com>
Change-Id: Ib87ef5da180ebac9248734721c133aa834e43a1a
diff --git a/tests/sdc-dcae-d/dcaed/dcaed_interface.robot b/tests/sdc-dcae-d/dcaed/dcaed_interface.robot
index fb1e7b4..481210d 100644
--- a/tests/sdc-dcae-d/dcaed/dcaed_interface.robot
+++ b/tests/sdc-dcae-d/dcaed/dcaed_interface.robot
@@ -1,6 +1,7 @@
 *** Settings ***
 Library           json
 Library           ONAPLibrary.Utilities
+Library           ONAPLibrary.SDC    WITH NAME    SDC
 Library           ONAPLibrary.Templating    WITH NAME    Templating
 Resource          common.robot
 
@@ -20,43 +21,21 @@
     ${map}=    Create Dictionary    vfcmtName=${vfcmt_name}   description=VFCMT created by robot
     Create Environment   create_vfcmt   ${ASSETS_DIR}
     ${data}=   Apply Template   create_vfcmt   ${DCAE_VFCMT_TEMPLATE}    ${map}
-    ${resp}=    Run DCAE-DS Post Request    ${DCAE_PATH}/createVFCMT     ${data}    ${ASDC_DESIGNER_USER_ID}
+    ${resp}=    SDC.Run Post Request    ${DCAE_BE_ENDPOINT}    ${DCAE_PATH}/createVFCMT     ${data}    ${ASDC_DESIGNER_USER_ID}
     Should Be Equal As Strings  ${resp.status_code}     200
     [Return]    ${resp.json()['uuid']}
 
-Run DCAE-DS Post Request
-    [Documentation]    Runs a DCAE-DS post request
-    [Arguments]    ${data_path}    ${data}    ${user}=${ASDC_DESIGNER_USER_ID}   ${MY_DCAE_BE_ENDPOINT}=${DCAE_BE_ENDPOINT}
-    Log    Creating session ${MY_DCAE_BE_ENDPOINT}
-    ${session}=    Create Session       sdc_dcae_ds    ${MY_DCAE_BE_ENDPOINT}
-    ${uuid}=    Generate UUID4
-    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json    USER_ID=${user}    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
-    ${resp}=    Post Request    sdc_dcae_ds    ${data_path}     data=${data}    headers=${headers}
-    Log    Received response from DCAE-BE: ${resp.text}
-    [Return]    ${resp}
-
-Run DCAE-DS Put Request
-    [Documentation]    Runs a DCAE-DS put request
-    [Arguments]    ${data_path}    ${user}=${ASDC_DESIGNER_USER_ID}   ${MY_DCAE_BE_ENDPOINT}=${DCAE_BE_ENDPOINT}
-    Log    Creating session ${MY_DCAE_BE_ENDPOINT}
-    ${session}=    Create Session       sdc_dcae_ds    ${MY_DCAE_BE_ENDPOINT}
-    ${uuid}=    Generate UUID4
-    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json    USER_ID=${user}    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
-    ${resp}=    Put Request    sdc_dcae_ds    ${data_path}    headers=${headers}
-    Log    Received response from DCAE-BE: ${resp.text}
-    [Return]    ${resp}
-
 Save Composition
     [Arguments]   ${vfcmt_uuid}   ${vf_uuid}
     ${map}=    Create Dictionary    cid=${vfcmt_uuid}   vf_id=${vf_uuid}
     Create Environment   dcae_composition   ${ASSETS_DIR}
     ${data}=   Apply Template   dcae_composition   ${DCAE_COMPOSITION_TEMPLATE}    ${map}
-    ${resp}=    Run DCAE-DS Post Request    ${DCAE_PATH}/saveComposition/${vfcmt_uuid}     ${data}    ${ASDC_DESIGNER_USER_ID}
+    ${resp}=    SDC.Run Post Request    ${DCAE_BE_ENDPOINT}    ${DCAE_PATH}/saveComposition/${vfcmt_uuid}     ${data}    ${ASDC_DESIGNER_USER_ID}
     Should Be Equal As Strings  ${resp.status_code}     200
 
 Certify VFCMT
     [Arguments]   ${vfcmt_uuid}
-    ${resp}=    Run DCAE-DS Put Request    ${DCAE_PATH}/certify/vfcmt/${vfcmt_uuid}
+    ${resp}=    SDC.Run Put Request    ${DCAE_BE_ENDPOINT}    ${DCAE_PATH}/certify/vfcmt/${vfcmt_uuid}    ${None}    ${ASDC_DESIGNER_USER_ID}
     Should Be Equal As Strings  ${resp.status_code}     200
     [Return]    ${resp.json()['uuid']}
 
@@ -65,13 +44,13 @@
     ${map}=    Create Dictionary    template_uuid=${vfcmt_uuid}   service_uuid=${cs_uuid}   vfi_name=${vfi_name}  name=${mc_name}
     Create Environment   dcae_monitoring_configuration   ${ASSETS_DIR}
     ${data}=   Apply Template   dcae_monitoring_configuration   ${DCAE_MONITORING_CONFIGURATION_TEMPLATE}    ${map}
-    ${resp}=    Run DCAE-DS Post Request    ${DCAE_PATH}/importMC     ${data}    ${ASDC_DESIGNER_USER_ID}
+    ${resp}=    SDC.Run Post Request    ${DCAE_BE_ENDPOINT}    ${DCAE_PATH}/importMC     ${data}    ${ASDC_DESIGNER_USER_ID}
     Should Be Equal As Strings  ${resp.status_code}     200
     [Return]    ${resp.json()['vfcmt']['uuid']}
 
 Submit Monitoring Configuration To DCAE-DS
     [Arguments]   ${mc_uuid}   ${cs_uuid}   ${vfi_name}
     ${url_vfi_name}   url_encode_string  ${vfi_name}
-    ${resp}=    Run DCAE-DS Post Request    ${DCAE_PATH}${DCAE_CREATE_BLUEPRINT_PATH}/${mc_uuid}/${cs_uuid}/${url_vfi_name}     ${None}    ${ASDC_DESIGNER_USER_ID}
+    ${resp}=    SDC.Run Post Request    ${DCAE_BE_ENDPOINT}    ${DCAE_PATH}${DCAE_CREATE_BLUEPRINT_PATH}/${mc_uuid}/${cs_uuid}/${url_vfi_name}     ${None}    ${ASDC_DESIGNER_USER_ID}
     Should Be Equal As Strings  ${resp.status_code}     200