Commit fc34183a authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

added doc for SOL002, SOL003 and SOL005 notificaitons

parent 36db7cfb
Loading
Loading
Loading
Loading
+135 −113
Original line number Original line Diff line number Diff line
*** Settings ***
*** Settings ***
Resource    environment/variables.txt 
Resource    environment/variables.txt 
Suite Setup    Create Sessions

Suite Teardown    Terminate All Processes    kill=true
Library    MockServerLibrary
Library    MockServerLibrary
Library    Process
Library    Process
Library    OperatingSystem
Library    OperatingSystem
Library    Collections

Suite Setup    Create Sessions
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
*** Test Cases ***
Deliver a notification - Alarm
VNF Fault Alarm Notification
    [Documentation]    Test ID: 7.4.5.1
    [Documentation]    Test ID: 6.3.4.6.1
    ...    Test title: Deliver a notification - Alarm
    ...    Test title: VNF Fault Alarm Notification
    ...    Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt.
    ...    Test objective: The objective is to test the dispatch of VNF Fault Alarm Notification when a virtualised resource within an VNF instance fails, and perform a JSON schema and content validation of the delivered notification
    ...    Pre-conditions: The VNF has subscribed to the VNFM alarm
    ...    Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm notifications is available in the VNFM.
    ...    Reference: section 7.4.5 - SOL002 v2.4.1
    ...    Reference:  section 7.4.7.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions:   
    ...    Post-Conditions: none 
    log    The POST method delivers a notification - Information of a VNF alarm.
    Trigger the fault of a virtualised resource in the VNF instance (external action) 
    ${json}=	Get File	schemas/alarmNotification.schema.json
    Check Alarm Notification Http POST Request Body Json Schema Is    alarmNotification
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    Check Alarm Notification Http POST Request Body notificationType attribute Is    alarmNotification
    Log  Creating mock request and response to handle alarmNotification
    &{req}=  Create Mock Request Matcher	POST  ${callback_endpoint}  body_type="JSON_SCHEMA"    body=${BODY}
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Log  Verifying results
    Wait Until Keyword Succeeds    ${sleep_interval}    Verify Mock Expectation    ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}


Deliver a notification - Alarm Clearance
VNF Fault Alarm Cleared Notification
    [Documentation]    Test ID: 7.4.5.2
    [Documentation]    Test ID: 6.3.4.6.2
    ...    Test title: Deliver a notification - Alarm Clearance
    ...    Test title: VNF Fault Alarm Cleared Notification
    ...    Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt.
    ...    Test objective: The objective is to test the dispatch of VNF Fault Alarm Cleared Notification when a faulty virtualised resource within an VNF instance is cleared, and perform a JSON schema and content validation of the delivered notification
    ...    Pre-conditions: The VNF has subscribed to the VNFM alarm
    ...    Pre-conditions: A VNF instance is instantiated, a virtualised resource is in faulty state, and a subscription for fault alarm cleared notifications is available in the VNFM.
    ...    Reference: section 7.4.5 - SOL002 v2.4.1
    ...    Reference:  section 7.4.7.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions:   
    ...    Post-Conditions: none 
    log    The POST method delivers a notification - Information of a VNF alarm.
    Trigger the fault cleared of a virtualised resource in the VNF instance (external action) 
    ${json}=	Get File	schemas/alarmClearedNotification.schema.json
    Check Alarm cleared Notification Http POST Request Body Json Schema Is    alarmClearedNotification
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    Check Alarm cleared Notification Http POST Request Body notificationType attribute Is    alarmClearedNotification
    Log  Creating mock request and response to handle alarmNotification
    &{req}=  Create Mock Request Matcher	POST  ${callback_endpoint}  body_type="JSON_SCHEMA"    body=${BODY}
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Log  Verifying results
    Wait Until Keyword Succeeds    ${sleep_interval}    Verify Mock Expectation    ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}


Deliver a notification - Alarm List Rebuilt
VNF Fault Alarm List Rebuilt Notification 
    [Documentation]    Test ID: 7.4.5.3
    [Documentation]    Test ID: 6.3.4.6.3
    ...    Test title: Deliver a notification - Alarm List Rebuilt
    ...    Test title: VNF Fault Alarm List Rebuilt Notification 
    ...    Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt.
    ...    Test objective: The objective is to test the dispatch of VNF Fault Alarm List Rebuilt Notification when the VNFM decides to rebuild the list of its VNF alarms, e.g. due to a corruption in the alarm storage, and perform a JSON schema and content validation of the delivered notification
    ...    Pre-conditions: The VNF has subscribed to the VNFM alarm
    ...    Pre-conditions: A VNF instance is instantiated, one or more virtualised resource are in faulty state, and a subscription for fault alarm list rebuilt notifications is available in the VNFM.
    ...    Reference: section 7.4.5 - SOL002 v2.4.1
    ...    Reference:  section 7.4.7.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions:  
    ...    Post-Conditions: none 
    log    The POST method delivers a notification - Information of a VNF alarm.
    Trigger the VNF fault alarm list rebuild in the NFVO (external action) 
    ${json}=	Get File	schemas/alarmListRebuiltNotification.schema.json
    Check Alarm list rebuilt Notification Http POST Request Body Json Schema Is    alarmListRebuiltNotification
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    Check Alarm list rebuilt Notification Http POST Request Body notificationType attribute Is    alarmListRebuiltNotification
    Log  Creating mock request and response to handle alarmNotification
    &{req}=  Create Mock Request Matcher  POST  ${callback_endpoint}  body_type="JSON_SCHEMA"    body=${BODY}
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Log  Verifying results
    Wait Until Keyword Succeeds    ${sleep_interval}    Verify Mock Expectation    ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}


Test a notification end point
    [Documentation]    Test ID: 7.4.5.4
    ...    Test title: Test a notification end point
    ...    Test objective: The objective is to allow the server to test the notification endpoint that is provided by the client, e.g. during subscription
    ...    Pre-conditions: 
    ...    Reference: section 7.4.5 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:  
    log    The GET method allows the server to test the notification endpoint
    &{req}=  Create Mock Request Matcher	GET  ${callback_endpoint}    
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Verify Mock Expectation  ${req}
    Clear Requests  ${callback_endpoint}


PUT notification - Method not implemented
*** Keywords ***
    Log  PUT Method not implemented
Trigger the fault of a virtualised resource in the VNF instance (external action)  
    &{req}=  Create Mock Request Matcher	PUT  ${callback_endpoint}
    #do nothing
    &{rsp}=  Create Mock Response  status_code=405
    Log    do nothing
    Create Mock Expectation  ${req}  ${rsp}

    Sleep  ${sleep_interval}
Trigger the fault cleared of a virtualised resource in the VNF instance (external action) 
    Log  Verifying results
    #do nothing
    Verify Mock Expectation  ${req}
    Log    do nothing   
    Log  Cleaning the endpoint

Trigger the VNF fault alarm list rebuild in the NFVO (external action) 
    #do nothing
    Log    do nothing 

Check Alarm List Rebuilt Notification 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 Alarm List Rebuilt Notification Http POST Request Body notificationType attribute Is
    [Arguments]    ${type}
    Configure Notification Alarm List Rebuilt 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}
    Clear Requests    ${callback_endpoint_fwd}


PATCH subscriptions - Method not implemented
Check Alarm Notification Http POST Request Body Json Schema Is    
    Log  PATCH Method not implemented
    [Arguments]    ${element}
    &{req}=  Create Mock Request Matcher	PATCH  ${callback_endpoint}
    ${schema}=	Get File	schemas/${element}.schema.json
    &{rsp}=  Create Mock Response  status_code=405
    Configure Notification Forward    ${schema}    ${callback_endpoint}    ${callback_endpoint_fwd}
    Create Mock Expectation  ${req}  ${rsp}

    Sleep  ${sleep_interval}
Check Alarm Notification Http POST Request Body notificationType attribute Is
    Log  Verifying results
    [Arguments]    ${type}
    Verify Mock Expectation  ${req}
    Configure Notification Alarm Handler    ${callback_endpoint_fwd}    ${type}
    Log  Cleaning the endpoint
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}

Check Alarm cleared Notification 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}
    
    
DELETE subscriptions - Method not implemented

    Log  DELETE Method not implemented
Check Alarm cleared Notification Http POST Request Body notificationType attribute Is
    &{req}=  Create Mock Request Matcher	DELETE  ${callback_endpoint}
    [Arguments]    ${type}
    &{rsp}=  Create Mock Response  status_code=405
    Configure Notification Alarm Cleareance Handler    ${callback_endpoint_fwd}    ${type}
    Create Mock Expectation  ${req}  ${rsp}
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
    
    
Check Alarm Clerance Notification Http POST Request Body changeType attribute Is
    [Arguments]    ${type}
    #do nothing
    Log    do nothing 
    

Configure Notification Alarm List Rebuilt 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
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{notification_response}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}

Configure Notification Alarm 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
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{notification_response}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}

Configure Notification Alarm Cleareance 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
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{notification_response}=  Create Mock Response	headers="Content-Type: application/json"  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}
    
    
*** Keywords ***
Create Sessions
Create Sessions
    Start Process  java  -jar  ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar  -serverPort  ${callback_port}  alias=mockInstance
    Start Process  java  -jar  ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}     #The API producer is set to NFVO according to SOL002-7.3.4
    Create Mock Session  ${callback_uri}:${callback_port}     #The API producer is set to NFVO according to SOL002-7.3.4
+8 −0
Original line number Original line Diff line number Diff line
@@ -30,8 +30,16 @@ ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${callback_uri}    http://localhost
${callback_uri}    http://localhost
${callback_port}    9091
${callback_port}    9091
${callback_endpoint}    /endpoint
${callback_endpoint}    /endpoint
${callback_endpoint_fwd}    /endpoint/check
${callback_endpoint_error}    /endpoint_404
${callback_endpoint_error}    /endpoint_404
${sleep_interval}    20s
${sleep_interval}    20s
${total_polling_time}   2 min
${polling_interval}     10 sec

${notification_request}    []
${notification_response}    []

${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar


${AlarmNotification}    {}
${AlarmNotification}    {}
${AlarmClearedNotification}    {}
${AlarmClearedNotification}    {}
+89 −92
Original line number Original line Diff line number Diff line
*** Setting ***
*** Setting ***
Resource	environment/notifications.txt
Resource	environment/variables.txt
Resource	environment/variables.txt
Suite Setup    Create Sessions
Suite Setup    Create Sessions
Suite Teardown    Terminate All Processes    kill=true
Suite Teardown    Terminate All Processes    kill=true
@@ -9,108 +10,104 @@ Library BuiltIn
Library    Collections
Library    Collections
Library    String
Library    String



*** Test Cases ***
*** Test Cases ***
Check Notification Endpoint
VNF Performance Information Availability Notification
    &{req}=  Create Mock Request Matcher	GET  ${callback_endpoint}    
    [Documentation]    Test ID: 6.3.3.8.1
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    ...    Test title: VNF Performance Information Availability Notification
    Create Mock Expectation  ${req}  ${rsp}
    ...    Test objective: The objective is to test the dispatch of VNF Performance Information Availability Notification when new VNF perfomance information is available in the NFVO, and perform a JSON schema and content validation of the delivered notification
    Sleep  ${sleep_interval}
    ...    Pre-conditions: A VNF performance job is created, and a subscription for information availability notifications is available in the VNFM.
    Verify Mock Expectation  ${req}
    ...    Reference:  section 6.4.9.3.1 - SOL002 v2.4.1
    Clear Requests  ${callback_endpoint}
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    Trigger the availability of VNF Performance Information (external action) 
    Check Performance Information Available Notification Http POST Request Body Json Schema Is    PerformanceInformationAvailableNotification
    Check Performance Information Available Notification Http POST Request Body notificationType attribute Is    PerformanceInformationAvailableNotification


Post Performance Information Available Notification
VNF Threshold Crossed Notification
    ${json}=	Get File	schemas/PerformanceInformationAvailableNotification.schema.json
    [Documentation]    Test ID: 6.3.3.8.2
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    ...    Test title: VNF Threshold Crossed Notification
    Log  Creating mock request and response to handle Performance Information Available Notification
    ...    Test objective: The objective is to test the dispatch of VNF Threshold Crossed Notification when a previously set VNF perfomance metric threshold is crossed, and perform a JSON schema and content validation of the delivered notification
    &{req}=  Create Mock Request Matcher	POST  ${callback_endpoint}  body_type="JSON_SCHEMA"    body=${BODY}
    ...    Pre-conditions: A VNF performance job is created, and a threshold subscription is available in the VNFM.
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    ...    Reference:  section 6.4.9.3.1 - SOL002 v2.4.1
    Create Mock Expectation  ${req}  ${rsp}
    ...    Config ID: Config_prod_VNFM
    Sleep  ${sleep_interval}
    ...    Applicability: none
    Log  Verifying results
    ...    Post-Conditions: none 
    Verify Mock Expectation  ${req}
    Trigger the cross of VNF Performance Threshold (external action) 
    Log  Cleaning the endpoint
    Check Threshold Crossed Notification Http POST Request Body Json Schema Is    ThresholdCrossedNotification
    Clear Requests  ${callback_endpoint}
    Check Threshold Crossed Notification Http POST Request Body notificationType attribute Is    ThresholdCrossedNotification




Post Performance Information Available Notification Negative 404 
*** Keywords ***
    ${json}=	Get File	schemas/ProblemDetails.schema.json
Trigger the availability of VNF Performance Information (external action) 
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    #do nothing
    Log  Creating mock request and response to handle Performance Information Available Notification to handle 404 error
    Log    do nothing
    &{req}=  Create Mock Request Matcher	POST  ${callback_endpoint_error}  body_type="JSON_SCHEMA"    body=${BODY}
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=404
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}


Post Threshold Crossed Notification
Trigger the cross of VNF Performance Threshold (external action) 
    ${json}=	Get File	schema/ThresholdCrossedNotification.schema.json
    #do nothing
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    Log    do nothing   
    Log  Creating mock request and response to handle Threshold Crossed Notification
    &{req}=  Create Mock Request Matcher	POST  ${callback_endpoint}  body_type="JSON_SCHEMA"    body=${BODY}
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}
  
  
Check Performance Information Available Notification 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}


PostThreshold Crossed Notification Negative 404 
Check Performance Information Available Notification Http POST Request Body notificationType attribute Is
    ${json}=	Get File	schemas/ProblemDetails.schema.json
    [Arguments]    ${type}
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    Configure Notification Performance Information Available Handler    ${callback_endpoint_fwd}    ${type}
    Log  Creating mock request and response to handleThreshold Crossed Notification to handle 404 error
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    &{req}=  Create Mock Request Matcher	POST  ${callback_endpoint_error}  body_type="JSON_SCHEMA"    body=${BODY}
    &{rsp}=  Create Mock Response	headers="Content-Type: application/json"  status_code=404
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}


Check Threshold Crossed Notification 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}
    
    
PUT Performance Notification 

    Log  PUT Method not implemented
Check Threshold Crossed Notification Http POST Request Body notificationType attribute Is
    &{req}=  Create Mock Request Matcher	PUT  ${callback_endpoint}
    [Arguments]    ${type}
    &{rsp}=  Create Mock Response  status_code=405
    Configure Notification Threshold Crossed Handler    ${callback_endpoint_fwd}    ${type}
    Create Mock Expectation  ${req}  ${rsp}
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
    
    
    
    
PATCH Performance Notification 
Check Threshold Crossed Notification Http POST Request Body changeType attribute Is
    Log  PATCH Method not implemented
    [Arguments]    ${type}
    &{req}=  Create Mock Request Matcher	PATCH  ${callback_endpoint}
    #do nothing
    &{rsp}=  Create Mock Response  status_code=405
    Log    do nothing 
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}
    
    
    
    
DELETE Performance Notification 
Configure Notification Performance Information Available Handler
    Log  PATCH Method not implemented
    [Arguments]    ${endpoint}    ${type}
    &{req}=  Create Mock Request Matcher	DELETE  ${callback_endpoint}
    ${json}=    evaluate    {}
    &{rsp}=  Create Mock Response  status_code=405
    set to dictionary    ${json}    notificationType    ${type}    
    Create Mock Expectation  ${req}  ${rsp}
    ${BODY}=    evaluate    json.dumps(${json})    json
    Sleep  ${sleep_interval}
    Log  Creating mock request and response to handle status notification
    Log  Verifying results
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    Verify Mock Expectation  ${req}
    &{notification_response}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Log  Cleaning the endpoint
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Clear Requests  ${callback_endpoint}


Configure Notification Threshold Crossed 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
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{notification_response}=  Create Mock Response	headers="Content-Type: application/json"  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}


*** Keywords ***
Create Sessions
Create Sessions
    Start Process  java  -jar  ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar  -serverPort  ${callback_port}  alias=mockInstance
    Start Process  java  -jar  ${MOCK_SERVER_JAR}  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}
    Create Mock Session  ${callback_uri}:${callback_port}
 No newline at end of file
+12 −0

File added.

Preview size limit exceeded, changes collapsed.

+136 −114

File changed.

Preview size limit exceeded, changes collapsed.

Loading