Commit 38738641 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

implemented missing test for 422 response code in NFV MANO CIM Subscriptions

parent 06ed3120
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -961,6 +961,27 @@ Send Post Request for Duplicated Subscription
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}  

Send POST request for subscription with unprocessable content
    Log    Creating a new subscription for unreachable notification endpoint
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/CimSubscriptionRequest.json
    ${body_request}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    Check GET response from Unreachable Notification Endpoint
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body_request}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check GET response from Unreachable Notification Endpoint
    Log    Creating mock request and response to handle GET operation on unreachable notification endpoint
    &{notification_request}=    Create Mock Request Matcher    GET    ${unreachable_callback_uri}
    &{notification_response}=    Create Mock Response    status_code=404
    Log    Issue the subscription request
    Create Mock Expectation    ${notification_request}    ${notification_response}
    Wait Until Keyword Succeeds    ${total_polling_time}   ${polling_interval}   Verify Mock Expectation    ${notification_request}
    Clear Requests  ${unreachable_callback_uri}

Check HTTP Response Body Is Empty
    Should Be Empty    ${response['body']}    
    Log    No json schema is provided. Validation OK  
+14 −1
Original line number Diff line number Diff line
@@ -137,6 +137,19 @@ POST Create request for duplicated Subscription creating duplicated subscription
    Check HTTP Response Body CimSubscription Attributes Values Match the Issued Subscription
    Check Postcondition Subscription Is Set

POST new subscription - Unprocessable Content
    [Documentation]    Test ID: 8.3.1.10.9a
    ...    Test title: POST new subscription - Unprocessable Content
    ...    Test objective:  The objective is to test the creation of a new subscription fails when a request contains syntactically correct data but the data cannot be processed.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.4.3.1 - ETSI GS NFV-SOL 005 [3] v5.1.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send POST request for subscription with unprocessable content
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails

PUT Subscriptions - Method not implemented
    [Documentation]    Test ID: 8.3.1.10.10
    ...    Test title: PUT Subscriptions - Method not implemented