Commit 974e29a5 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

[test-new][SOL023][CERT-NOTIF][v5.3.1][13.3.2.x.x Test-IDs] Implemented new...

[test-new][SOL023][CERT-NOTIF][v5.3.1][13.3.2.x.x Test-IDs] Implemented new test cases for Certificate Notificatio Interface, resources: subscriptions, individual subscriptions, notification.
parent b884815a
Loading
Loading
Loading
Loading
+213 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    environment/variables.txt
Library     REST
...         ${CM_SCHEMA}://${CM_HOST}:${CM_PORT}
...         ssl_verify=false
Library     OperatingSystem
Library     JSONLibrary
Library     JSONSchemaLibrary    schemas/

*** Test Cases ***
POST API Version - Method not implemented
    [Documentation]    Test ID: 13.3.2.1.1
    ...    Test title: POST API version - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none    
    POST API Version
	Check HTTP Response Status Code Is    405
    
GET API Version
    [Documentation]    Test ID: 13.3.2.1.2
    ...    Test title: GET API Version
    ...    Test objective: The objective is to test that GET method successfully return ApiVersionInformation
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    GET API Version
	Check HTTP Response Status Code Is    200
	Check HTTP Response Body Json Schema Is    ApiVersionInformation

PUT API Version - Method not implemented
    [Documentation]    Test ID: 13.3.2.1.3
    ...    Test title: PUT API Version - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PUT API Version
	Check HTTP Response Status Code Is    405

PATCH API Version - Method not implemented
    [Documentation]    Test ID: 13.3.2.1.4
    ...    Test title: PATCH API Version - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PATCH API Version
	Check HTTP Response Status Code Is    405
    
DELETE API Version - Method not implemented
    [Documentation]    Test ID: 13.3.2.1.5
    ...    Test title: DELETE API Version - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    DELETE API Version
	Check HTTP Response Status Code Is    405
	
POST API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.2.1.6
    ...    Test title: POST API version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none    
    POST API Version
	Check HTTP Response Status Code Is    405
    
GET API Version with apiMajorVerion
    [Documentation]    Test ID: 13.3.1.1.7
    ...    Test title: GET API Version with apiMajorVerion
    ...    Test objective: The objective is to test that GET method successfully return ApiVersionInformation
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    GET API Version
	Check HTTP Response Status Code Is    200
	Check HTTP Response Body Json Schema Is    ApiVersionInformation

PUT API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.8
    ...    Test title: PUT API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PUT API Version
	Check HTTP Response Status Code Is    405

PATCH API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.9
    ...    Test title: PATCH API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PATCH API Version
	Check HTTP Response Status Code Is    405
    
DELETE API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.10
    ...    Test title: DELETE API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    DELETE API Version
	Check HTTP Response Status Code Is    405

*** Keywords ***
POST API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Post    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
GET API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PUT API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Put    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PATCH API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
DELETE API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
POST API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
GET API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PUT API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Put    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PATCH API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
DELETE API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Log    Status code validated 

Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    ${schema} =    Catenate    SEPARATOR=    ${input}    .schema.json
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
 No newline at end of file
+299 −0

File added.

Preview size limit exceeded, changes collapsed.

+122 −0
Original line number Diff line number Diff line
*** Settings ***
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt
Library           OperatingSystem
Library           JSONLibrary
Resource          CertificateNotificationKeywords.robot

*** Test Cases ***
GET Individual Subscription
    [Documentation]    Test ID: 13.3.2.3.1
    ...    Test title: GET Individual  Subscription
    ...    Test objective: The objective is to test the retrieval of individual subscription and perform a JSON schema and content validation of the returned subscription data structure
    ...    Pre-conditions: At least one subscription is available in the CMF.
    ...    Reference: clause 7.5.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   CertificateSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription

GET Individual Subscription - invalid resource identifier
    [Documentation]    Test ID: 13.3.2.3.2
    ...    Test title: GET Individual Subscription - invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual subscription fails when using an invalid resource identifier
    ...    Pre-conditions: At least one subscription is available in the CMF.
    ...    Reference: clause 7.5.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

DELETE Individual Subscription
    [Documentation]    Test ID: 13.3.2.3.3
    ...    Test title: DELETE Individual Subscription
    ...    Test objective: The objective is to test the deletion of an individual subscription
    ...    Pre-conditions: At least one subscription is available in the CMF.
    ...    Reference: clause 7.5.4.3.5 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: The resource is not available anymore in the CMF    
    Send Delete request for individual Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition Subscription is Deleted

DELETE Individual Subscription - invalid resource identifier
    [Documentation]    Test ID: 13.3.2.3.4
    ...    Test title: DELETE Individual Subscription - invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual  subscription fails when using an invalid resource identifier
    ...    Pre-conditions: At least one subscription is available in the CMF.
    ...    Reference: clause 7.5.4.3.5 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none   
    Send Delete request for individual Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

POST Individual Subscription - Method not implemented
    [Documentation]    Test ID: 13.3.2.3.5
    ...    Test title: POST Individual Subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new Subscription
    ...    Pre-conditions: none
    ...    Reference: clause 7.5.4.3.1 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post request for individual Subscription
    Check HTTP Response Status Code Is    405

PUT Individual Subscription - Method not implemented
    [Documentation]    Test ID: 13.3.2.3.6
    ...    Test title: PUT Individual Subscription - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing subscription
    ...    Pre-conditions: none
    ...    Reference: clause 7.5.4.3.3 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Put request for individual Subscription
    Check HTTP Response Status Code Is    405

PATCH Individual Subscription - Method not implemented
    [Documentation]    Test ID: 13.3.2.3.7
    ...    Test title: PATCH Individual Subscription - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing subscription
    ...    Pre-conditions: none
    ...    Reference: clause 7.5.4.3.4 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Patch request for individual Subscription
    Check HTTP Response Status Code Is    405

GET Individual Subscription with permitted authorization scope
    [Documentation]    Test ID: 13.3.2.3.8
    ...    Test title: GET Individual  Subscription with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of individual subscription when a permitted authorization scope is used.
    ...    Pre-conditions: At least one subscription is available in the CMF.
    ...    Reference: clause 7.5.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Subscription with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   CertificateSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription

GET Individual Subscription with not permitted authorization scope
    [Documentation]    Test ID: 13.3.2.3.9
    ...    Test title: GET Individual  Subscription with not permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of individual subscription fails when a not permitted authorization scope is used.
    ...    Pre-conditions: At least one subscription is available in the CMF.
    ...    Reference: clause 7.5.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Subscription with not permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   CertificateSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription
 No newline at end of file
+49 −0
Original line number Diff line number Diff line
*** Settings ***
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt
Library     REST
...         ${CM_SCHEMA}://${CM_HOST}:${CM_PORT}
...         ssl_verify=false
Library           OperatingSystem
Library           JSONLibrary
Library           String
Suite Setup       Check resource existence and get CallbackUri

*** Test Cases ***
Certificate Lifecycle State Change Notification Delivery
    [Documentation]    Test ID: 13.3.2.5.1
    ...    Test title: Certificate Lifecycle State Change Notification Delivery
    ...    Test objective: The objective is to test that Certificate Lifecycle State Change Notification is delivered with success to the notification consumer
    ...    Pre-conditions: A subscription for information availability notification is available in the CMF.
    ...    Reference: clause 7.5.5.2.1 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post Certificate Lifecycle State Change Notification
    Check HTTP Response Status Code Is    204
    
*** Keywords ***
Check resource existence and get CallbackUri
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    Integer    response status    200
    Validate Json    response body    schemas/CertificateSubscription.schema.json
    Set Global Variable    ${callbackResp}    response body callbackUri

Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Log    Status code validated 

Post Certificate Lifecycle State Change Notification
    log    Trying to perform a POST to get notification
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template} =    Get File    jsons/DataAnalyticsChangeNotification.json  
    ${body}=    Format String    ${template}    subscriptionId=${subscriptionId}
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
+105 −0
Original line number Diff line number Diff line
*** Setting ***
Resource    environment/variables.txt
Suite Setup    Create Sessions
Suite Teardown    Terminate All Processes    kill=true
Library    MockServerLibrary
Library    Process
Library    OperatingSystem
Library    BuiltIn
Library    Collections
Library    String
Library     REST
...         ${CM_SCHEMA}://${CM_HOST}:${CM_PORT}
...         ssl_verify=false


*** Test Cases ***
Certificate Lifecycle State Change Notification
    [Documentation]    Test ID: 13.3.2.4.1
    ...    Test title: Certificate Lifecycle State Change Notification
    ...    Test objective: The objective is to test the dispatch of Certificate Lifecycle State Change Notification when changes on the certificate occur, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system.
    ...    Pre-conditions: A subscription for Certificate Lifecycle State Change Notification is available in the CMF.
    ...    Reference: clause 7.5.5.2.1 - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: Config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    Trigger the availability of Certificate Lifecycle State Change Notification (external action) 
    Check Certificate Lifecycle State Change Notification Available Http POST Request Body Json Schema Is    CertificateLifecycleStateChangeNotification
    Check Certificate Lifecycle State Change Notification Available Http POST Request Body notificationType attribute Is    CertificateLifecycleStateChangeNotification
    Check Certificate Lifecycle State Change Notification Available

*** Keywords ***
Trigger the availability of Certificate Lifecycle State Change Notification (external action) 
    #do nothing
    Log    do nothing
  
Check Certificate Lifecycle State Change Notification Available Http POST Request Body Json Schema Is    
    [Arguments]    ${element}
    ${schema}=  Get File    schemas/${element}.schema.json
    Configure Notification Forward    ${schema}    ${callback_endpoint}    ${callback_endpoint_fwd}

Check Certificate Lifecycle State Change Notification Available Http POST Request Body notificationType attribute Is
    [Arguments]    ${type}
    Configure Notification Change Notification Available Handler    ${callback_endpoint_fwd}    ${type}
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    #Clear Requests    ${callback_endpoint}
    #Clear Requests    ${callback_endpoint_fwd}    
    
    
Configure Notification Change Notification Available Handler
    [Arguments]    ${endpoint}    ${type}
    ${json}=    evaluate    {}
    set to dictionary    ${json}    notificationType    ${type}    
    ${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}
    Set Global Variable    ${notification_request}    ${req}   
    &{notification_response}=  Create Mock Response    status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}
  
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_fwd}=  Create Mock Http Forward  ${endpoint_fwd}
    Create Mock Expectation With Http Forward  ${notification_tmp}  ${notification_fwd}

Create Sessions
    Start Process  java  -jar  ${MOCK_SERVER_JAR}  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}

Check Certificate Lifecycle State Change Notification Available
    [Arguments]    ${expected_notification_type}=CertificateLifecycleStateChangeNotification
    ${requests}=    Retrieve Requests    ${callback_endpoint_fwd}
    Should Not Be Empty    ${requests}    msg=No notification received at callback endpoint!

    ${request_type}=    Evaluate    type(${requests})
    Log    Request type: ${request_type}

    ${last_request}=    Run Keyword If    "${request_type}" == "<class 'list'>"
    ...    Get From List    ${requests}    -1
    ...    ELSE
    ...    Set Variable    ${requests}

    ${body}=    Get From Dictionary    ${last_request}    body
    ${body_text}=    Get From Dictionary    ${body}    string

    ${notification}=    Evaluate    json.loads(r'''${body_text}''')    json
    Log    Parsed notification: ${notification}

    Should Be Equal As Strings    ${notification['notificationType']}    ${expected_notification_type}

    ${subscriptionId}=    Get From Dictionary    ${notification}    subscriptionId

    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Version": "${API_VERSION}"}
    Run Keyword If    ${AUTH_USAGE} == 1
    ...    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}

    # Validate entity exists
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    Integer    response status    200

    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
 No newline at end of file
Loading