Commit 131fe232 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch 'SOL003-VirtualisedResourcesQuota' into '4.5.1-dev'

SOL003 Virtualised Quota - Implementation of deltas between v4.5.1 and v4.4.1

See merge request !348
parents 5d1b5ca5 e9d10610
Loading
Loading
Loading
Loading
+32 −6
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ Create new Virtualised Resources Quota Available Notification individual subscri
    ...    Test title: Create new Virtualised Resources Quota Available Notification individual subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new Virtualised Resources Quota Available Notification individual subscription instance on VNF 
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 11.4.3.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.3.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -27,7 +27,7 @@ Get Information about an individual subscription
    ...    Test title: Get Information about an individual subscription
    ...    Test objective: The objective is to read an individual Virtualised Resources Quota Available Notification subscription subscribed by the client and perform a JSON schema and content validation of the returned individual subscription data structure 
    ...    Pre-conditions: The subscription with the given id exists
    ...    Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none 
    ...    Post-Conditions: none
@@ -40,7 +40,7 @@ PUT an individual subscription - Method not implemented
    ...    Test title: PUT an individual subscription - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update a existing Virtualised Resources Quota Available Notification individual subscription instance on VNF 
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 11.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -52,7 +52,7 @@ PATCH an individual subscription - Method not implemented
    ...    Test title: PATCH an individual subscription - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify a existing Virtualised Resources Quota Available Notification individual subscription instance on VNF 
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 11.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -64,7 +64,7 @@ DELETE an individual subscription
    ...    Test title: DELETE an individual subscription
    ...    Test objective: The objective is to test that Delete method is allowed to remove a existing Virtualised Resources Quota Available Notification individual subscription instance on VNF  
    ...    Pre-conditions: The subscription with the given id exists
    ...    Reference: Clause 11.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -77,10 +77,36 @@ Get Information about an individual subscription - Not Found
    ...    Test title: Get Information about an individual subscription - Not Found
    ...    Test objective: The objective is to test that the retrieval of an individual Virtualised Resources Quota Available Notification subscription subscribed by the client fils when resource is not present 
    ...    Pre-conditions: The subscription with the given id does not exists
    ...    Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none 
    ...    Post-Conditions: none
    Get Virtualised Resources Quota Available Notification individual subscription
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails

Get Information about an individual subscription with permitted authorization scope 
    [Documentation]    Test ID: 7.3.7.2.7
    ...    Test title: Get Information about an individual subscription with permitted authorization scope 
    ...    Test objective: The objective is to read an individual Virtualised Resources Quota Available Notification subscription subscribed by the client and perform a JSON schema and content validation of the returned individual subscription data structure with permitted authorization scope  
    ...    Pre-conditions: The subscription with the given id exists
    ...    Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none 
    ...    Post-Conditions: none
    Get Virtualised Resources Quota Available Notification individual subscription with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    VrQuotaAvailSubscription

Get Information about an individual subscription with not permitted authorization scope 
    [Documentation]    Test ID: 7.3.7.2.8
    ...    Test title: Get Information about an individual subscription with not permitted authorization scope 
    ...    Test objective: The objective is to read an individual Virtualised Resources Quota Available Notification subscription subscribed by the client and perform a JSON schema and content validation of the returned individual subscription data structure with not permitted authorization scope 
    ...    Pre-conditions: The subscription with the given id exists
    ...    Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none 
    ...    Post-Conditions: none
    Get Virtualised Resources Quota Available Notification individual subscription with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is    ProblemDetails
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Vr Quota Availibility Notification
    ...    Test title: Vr Quota Availibility Notification
    ...    Test objective: The objective is to test that Vr Quota Availibility Notification is delivered with success to the notification consumer
    ...    Pre-conditions: The VNF has subscribed to the Vr Quota Availibility resource
    ...    Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions:  none
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Virtualised Resource Quota Available Notification
    ...    Test title: Virtualised Resource Quota Available Notification
    ...    Test objective: The objective is to test the dispatch of Virtualised Resource Quota Available Notification, 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 Virtualised Resource Quota Available Notification is available in the VNFM.
    ...    Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
+40 −13
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ Create new Virtualised Resources Quota Available Notification subscription
    ...    Test title: Create new Virtualised Resources Quota Available Notification subscription
    ...    Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned subscription data structure 
    ...    Pre-conditions: no subscription with the same filter and callback Uri exists
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -29,7 +29,7 @@ Create new Virtualised Resources Quota Available Notification subscription - DUP
    ...    Test title: Create new Virtualised Resources Quota Available Notification subscription - DUPLICATION
    ...    Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned duplicated subscription data structure
    ...    Pre-conditions: subscription with the same filter and callback Uri exists
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: the VNFM allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists
    ...    Post-Conditions: none
@@ -43,7 +43,7 @@ Create new Virtualised Resources Quota Available Notification subscription - NO-
    ...    Test title: Create new Virtualised Resources Quota Available Notification subscription - NO-DUPLICATION
    ...    Test objective: The objective is to create a nduplicated Virtualised Resources Quota Available Notification subscription and verify that the VNF does not allow duplication
    ...    Pre-conditions: subscription with the same filter and callback Uri exists
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: the VNFM decides to not create a duplicate subscription resource 
    ...    Post-Conditions: none
@@ -56,7 +56,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions
    ...    Test title: GET Virtualised Resources Quota Available Notification Subscriptions 
    ...    Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions and perform a JSON schema and content validation of the returned  subscriptions data structure
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  none
    ...    Post-Conditions: none
@@ -69,7 +69,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions with attrib
    ...    Test title: GET Virtualised Resources Quota Available Notification Subscriptions with attribute-based Filter
    ...    Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions and perform a JSON schema and content validation of the returned subscriptions data structure, and verify that the retrieved information matches the issued attribute-based filters
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  none
    ...    Post-Conditions: none
@@ -82,7 +82,7 @@ GET Virtualised Resources Quota Available Notification subscriptions - Bad Reque
    ...    Test title: GET Virtualised Resources Quota Available Notification subscriptions - Bad Request Invalid attribute-based filtering parameters
    ...    Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions with invalid attribute-based filtering parameters, and verify that problem details are returned 
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none 
    ...    Post-Conditions: none
@@ -95,7 +95,7 @@ PUT Virtualised Resources Quota Available Notification subscriptions - Method no
    ...    Test title: PUT Virtualised Resources Quota Available Notification subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update existing Virtualised Resources Quota Available Notification subscriptions instance on VNF 
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 11.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -107,7 +107,7 @@ PATCH Virtualised Resources Quota Available Notification subscriptions - Method
    ...    Test title: PATCH Virtualised Resources Quota Available Notification subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify Virtualised Resources Quota Available Notification subscriptions instance on VNF 
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 11.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -119,7 +119,7 @@ DELETE Virtualised Resources Quota Available Notification subscriptions - Method
    ...    Test title: DELETE Virtualised Resources Quota Available Notification subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to delete Virtualised Resources Quota Available Notification subscriptions instance on VNF 
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 11.4.2.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -131,7 +131,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions as Paged Re
    ...    Test title: GET Virtualised Resources Quota Available Notification Subscriptions as Paged Response 
    ...    Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions as a Paged Response.
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  The VNFM supports response paging for the subscription resources
    ...    Post-Conditions: none
@@ -144,7 +144,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions as Paged Re
    ...    Test title: GET Virtualised Resources Quota Available Notification Subscriptions as Paged Response with nextpage_opauque_marker parameter    
    ...    Test objective: The objective is to query the list of active Virtualised Resources Quota Available Notification subscriptions as a Paged Response and retrieve the next page using the nextpage_opaque_marker parameter
    ...    Pre-conditions: A request for retrieving the list of active Virtualised Resources Quota Available Notification subscriptions as a paged response has been successfully issued (Test ID 7.3.7.1.10)
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: The VNFM supports response paging for the subscription resources
    ...    Post-Conditions: none 
@@ -156,7 +156,7 @@ GET Virtualised Resources Quota Available Notification subscriptions - Bad Reque
    ...    Test title: GET Virtualised Resources Quota Available Notification subscriptions - Bad Request Response too Big
    ...    Test objective: The objective is to test that the retrieval of active Virtualised Resources Quota Available Notification subscriptions list fails because response is too big, and verify that problem details are returned 
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none 
    ...    Post-Conditions: none
@@ -169,10 +169,37 @@ Create new Virtualised Resources Quota Available Notification Subscription - Unp
    ...    Test title: Create new Virtualised Resources Quota Available Notification Subscription - Unprocessable Content
    ...    Test objective: The objective is to test that content type of the message content is supported and the message content of a request contains syntactically correct data but the data cannot be processed.
    ...    re-conditions: none
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post request for new Virtualised Resources Quota Available Notification subscription
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is  ProblemDetails

Create new Virtualised Resources Quota Available Notification subscription with permitted authorization scope 
    [Documentation]    Test ID: 7.3.7.1.13
    ...    Test title: Create new Virtualised Resources Quota Available Notification subscription with permitted authorization scope 
    ...    Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned subscription data structure with permitted authorization scope 
    ...    Pre-conditions: no subscription with the same filter and callback Uri exists
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post request for new Virtualised Resources Quota Available Notification subscription with permitted authorization scope
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body Json Schema Is    VrQuotaAvailSubscription

Create new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope 
    [Documentation]    Test ID: 7.3.7.1.14
    ...    Test title: Create new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope 
    ...    Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned subscription data structure with not permitted authorization scope 
    ...    Pre-conditions: no subscription with the same filter and callback Uri exists
    ...    Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post request for new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is    ProblemDetails
 No newline at end of file
+66 −3
Original line number Diff line number Diff line
@@ -83,6 +83,26 @@ Get Virtualised Resources Quota Available Notification individual subscription
    ${outputResponse}=    Output    response 
    Set Global Variable    ${response}    ${outputResponse}

Get Virtualised Resources Quota Available Notification individual subscription with permitted authorization scope 
    log    Trying to get information about an individual subscription with permitted authorization scope 
    Set Headers    {"Accept":"${ACCEPT}"}  
    ${scopeValue}=    Create Dictionary    scopeValue=${VRQAN_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response 
    Set Global Variable    ${response}    ${outputResponse}

Get Virtualised Resources Quota Available Notification individual subscription with not permitted authorization scope 
    log    Trying to get information about an individual subscription with not permitted authorization scope 
    Set Headers    {"Accept":"${ACCEPT}"}  
    ${scopeValue}=    Create Dictionary    scopeValue=${VRQAN_NOT_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response 
    Set Global Variable    ${response}    ${outputResponse}

Delete Virtualised Resources Quota Available Notification individual subscription
    log    Try to delete an individual subscription
    Set Headers  {"Accept":"${ACCEPT}"}  
@@ -147,6 +167,46 @@ Send Post request for new Virtualised Resources Quota Available Notification sub
	Verify Mock Expectation   ${notification_request}
	Clear Requests    ${callback_endpoint}

Send Post request for new Virtualised Resources Quota Available Notification subscription with permitted authorization scope 
    Log    Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions with permitted authorization scope 
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    ${scopeValue}=    Create Dictionary    scopeValue=${VRQAN_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    ${template}=    Get File    jsons/vrQuotaAvailSubscriptionRequest.json
    ${body}=        Format String   ${template}    callback_uri=${callback_uri}:${callback_port}    callback_subscribe=${callback_subscribe}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}
    &{notification_response}=  Create Mock Response	status_code=204
    Log    Issue the subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    allow_redirects=false
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Verify Mock Expectation   ${notification_request}
	Clear Requests    ${callback_endpoint}

Send Post request for new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope 
    Log    Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions with not permitted authorization scope 
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    ${scopeValue}=    Create Dictionary    scopeValue=${VRQAN_NOT_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    ${template}=    Get File    jsons/vrQuotaAvailSubscriptionRequest.json
    ${body}=        Format String   ${template}    callback_uri=${callback_uri}:${callback_port}    callback_subscribe=${callback_subscribe}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}
    &{notification_response}=  Create Mock Response	status_code=204
    Log    Issue the subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    allow_redirects=false
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Verify Mock Expectation   ${notification_request}
	Clear Requests    ${callback_endpoint}
    
GET Virtualised Resources Quota Available Notification Subscriptions
    Log    Get the list of active subscriptions
    Set Headers  {"Accept":"${ACCEPT}"} 
@@ -220,4 +280,7 @@ Check HTTP Response Header Contain Link
    Should Be Equal As Integers	${length}	0
    Set Global Variable    ${nextPageUri}    ${linkHeaderUri[0]}

      
 No newline at end of file
JWT Encode
    [Arguments]    ${payload}    ${key}    ${algorithm}
    ${encoded}=    Evaluate    jwt.encode(${payload}, ${key}, ${algorithm})
    [Return]    ${encoded}
 No newline at end of file
Loading