Commit 99acb1bf authored by Eisha Ayaz's avatar Eisha Ayaz
Browse files

[test-upd][SOL025][ANALYTICS][v5.4.1][12.3.1.6.x Test-IDs][NFVIFA(26)000116]...

[test-upd][SOL025][ANALYTICS][v5.4.1][12.3.1.6.x Test-IDs][NFVIFA(26)000116] Add support for verification of authentication header in TelcoCloudAnalytics notification messages as per issue#33 in NFVIFA(26)000116
parent 27c1861f
Loading
Loading
Loading
Loading
+8 −1
Changes for SOL025/TelcoCloudDataAnalyticsService-API/Notifications.robot: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -49,6 +49,12 @@ Check Data Analytics Change Notification Available Http POST Request Body Json S
    ${schema}=  Get File    schemas/${element}.schema.json
    Configure Notification Forward    ${schema}    ${callback_endpoint}    ${callback_endpoint_fwd}

Update Mock Request Matcher With Headers
    [Arguments]    ${matcher}    ${headerType}    ${headerValue}
    ${hdr}=    Create Dictionary    name=${headerType}    values=${{ [${headerValue}] }}
    Set To Dictionary    ${matcher}    headers=${{ [$hdr] }}
    RETURN    ${matcher}

Check Data Analytics Change Notification Available Http POST Request Body notificationType attribute Is
    [Arguments]    ${type}
    Configure Notification Data Analytics Change Notification Available Handler    ${callback_endpoint_fwd}    ${type}
@@ -64,6 +70,7 @@ Configure Notification Data Analytics Change Notification Available Handler
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    &{req}=  Create Mock Request Matcher    POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{req}=  Update Mock Request Matcher With Headers    ${req}    ${AUTHORIZATION_HEADER}    ${AUTHORIZATION_TOKEN_NOTIF}
    Set Global Variable    ${notification_request}    ${req}   
    &{notification_response}=  Create Mock Response    status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}
@@ -72,6 +79,7 @@ Configure Notification Forward
    [Arguments]    ${schema}    ${endpoint}    ${endpoint_fwd}    
    Log  Creating mock Http POST forward to handle ${schema}
    &{notification_tmp}=  Create Mock Request Matcher   POST  ${endpoint}  body_type="JSON_SCHEMA"    body=${schema}
    &{notification_tmp}=  Update Mock Request Matcher With Headers    ${notification_tmp}    ${AUTHORIZATION_HEADER}    ${AUTHORIZATION_TOKEN_NOTIF}
    &{notification_fwd}=  Create Mock Http Forward  ${endpoint_fwd}
    Create Mock Expectation With Http Forward  ${notification_tmp}  ${notification_fwd}

@@ -113,4 +121,3 @@ Check Data Analytics Change Notification Available And Analytics State

    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
+1 −1
Changes for SOL025/TelcoCloudDataAnalyticsService-API/environment/variables.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ ${CONTENT_TYPE} application/json
${CONTENT_TYPE_PATCH}    application/merge-patch+json
${AUTHORIZATION_HEADER}    Authorization
${AUTHORIZATION_TOKEN}    Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${AUTHORIZATION_TOKEN_NOTIF}    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ98927
${API_VERSION}         1.0.0
${response}=    httpresponse
${invalidTcdaType}    RANDOM_TYPE
@@ -25,7 +26,6 @@ ${notExistingReportId} notExistingReportId
${analyticsId}      analyticsID
${reportId}      reportID
${original_etag}    some_etag
${etag}     etag

${CHECKS_NOTIF_ENDPOINT}    1   ## If true, during subscription, the FUT performs a get to the notification endpoint