Commit 37182d4d authored by Hammad Zafar's avatar Hammad Zafar Committed by Giacomo Bernini
Browse files

updated usage of auth header

parent 65bfd90b
Loading
Loading
Loading
Loading
+20 −20
Original line number Original line Diff line number Diff line
@@ -109,7 +109,7 @@ Check subscription existence
    
    
Check Postcondition Individual Subscription Resource Returned in Location Header Is Available
Check Postcondition Individual Subscription Resource Returned in Location Header Is Available
    Log    Going to check postcondition
    Log    Going to check postcondition
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${response['headers']['Location']}
    GET    ${response['headers']['Location']}
    Integer    response status    200
    Integer    response status    200
    Log    Received a 200 OK as expected
    Log    Received a 200 OK as expected
@@ -125,7 +125,7 @@ Check Postcondition Individual Subscription Resource Returned in Location Header


Check Postcondition Policy subscription is created
Check Postcondition Policy subscription is created
    Log    Going to check postcondition
    Log    Going to check postcondition
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']}
    Integer    response status    200
    Integer    response status    200
    Log    Received a 200 OK as expected
    Log    Received a 200 OK as expected
@@ -201,7 +201,7 @@ GET Subscriptions
Get subscriptions with all_fields attribute selector
Get subscriptions with all_fields attribute selector
    Log    Get the list of active subscriptions, using fields
    Log    Get the list of active subscriptions, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?all_fields
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?all_fields
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -209,7 +209,7 @@ Get subscriptions with all_fields attribute selector
Get subscriptions with exclude_default attribute selector
Get subscriptions with exclude_default attribute selector
    Log    Get the list of active subscriptions, using fields
    Log    Get the list of active subscriptions, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_default
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_default
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -217,7 +217,7 @@ Get subscriptions with exclude_default attribute selector
Get subscriptions with fields attribute selector
Get subscriptions with fields attribute selector
    Log    Get the list of active subscriptions, using fields
    Log    Get the list of active subscriptions, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}	
    Set Suite Variable    ${response}    ${output}	
@@ -225,7 +225,7 @@ Get subscriptions with fields attribute selector
Get subscriptions with exclude_fields attribute selector
Get subscriptions with exclude_fields attribute selector
    Log    Get the list of active subscriptions, using fields
    Log    Get the list of active subscriptions, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_fields=${fields}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_fields=${fields}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}     
    Set Suite Variable    ${response}    ${output}     
@@ -233,7 +233,7 @@ Get subscriptions with exclude_fields attribute selector
GET subscriptions with filter  
GET subscriptions with filter  
    Log    Get the list of active subscriptions using a filter
    Log    Get the list of active subscriptions using a filter
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -241,7 +241,7 @@ GET subscriptions with filter
Get subscriptions - invalid filter
Get subscriptions - invalid filter
    Log    Get the list of active subscriptions using an invalid filter
    Log    Get the list of active subscriptions using an invalid filter
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} 
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} 
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -249,7 +249,7 @@ Get subscriptions - invalid filter
Get subscriptions with exclude_default and fields attribute selector
Get subscriptions with exclude_default and fields attribute selector
    Log    Get the list of active subscriptions, using fields
    Log    Get the list of active subscriptions, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields}&exclude_default
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields}&exclude_default
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -363,7 +363,7 @@ POST Policy Conflict Notification
GET reach the notification endpoint  
GET reach the notification endpoint  
    Log    Trying to reach the notification endpoint using GET method.
    Log    Trying to reach the notification endpoint using GET method.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${callbackResp}
    GET    ${callbackResp}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -371,7 +371,7 @@ GET reach the notification endpoint
PUT notification endpoint  
PUT notification endpoint  
    Log    Trying to perform a PUT. This method should not be implemented.
    Log    Trying to perform a PUT. This method should not be implemented.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Put    ${callbackResp}
    Put    ${callbackResp}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -379,7 +379,7 @@ PUT notification endpoint
PATCH notification endpoint  
PATCH notification endpoint  
    Log    Trying to perform a PATCH. This method should not be implemented.
    Log    Trying to perform a PATCH. This method should not be implemented.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${callbackResp}
    Patch    ${callbackResp}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -387,7 +387,7 @@ PATCH notification endpoint
DELETE notification endpoint  
DELETE notification endpoint  
    Log    Trying to perform a DELETE. This method should not be implemented.
    Log    Trying to perform a DELETE. This method should not be implemented.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${callbackResp}
    Delete    ${callbackResp}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -416,7 +416,7 @@ GET Policies
GET Policies with filter  
GET Policies with filter  
    Log    Get the list of existing policies using a filter
    Log    Get the list of existing policies using a filter
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?${sub_filter}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?${sub_filter}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -424,7 +424,7 @@ GET Policies with filter
Get Policies - invalid filter
Get Policies - invalid filter
    Log    Get the list of existing policies using an invalid filter
    Log    Get the list of existing policies using an invalid filter
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?${sub_filter_invalid} 
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?${sub_filter_invalid} 
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -432,7 +432,7 @@ Get Policies - invalid filter
Get Policies with all_fields attribute selector
Get Policies with all_fields attribute selector
    Log    Get the list of existing policies, using fields
    Log    Get the list of existing policies, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?all_fields
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?all_fields
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -440,7 +440,7 @@ Get Policies with all_fields attribute selector
Get Policies with exclude_default attribute selector
Get Policies with exclude_default attribute selector
    Log    Get the list of existing policies, using fields
    Log    Get the list of existing policies, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?exclude_default
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?exclude_default
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -448,7 +448,7 @@ Get Policies with exclude_default attribute selector
Get Policies with fields attribute selector
Get Policies with fields attribute selector
    Log    Get the list of existing policies, using fields
    Log    Get the list of existing policies, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?fields=${fields}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?fields=${fields}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}	
    Set Suite Variable    ${response}    ${output}	
@@ -456,7 +456,7 @@ Get Policies with fields attribute selector
Get Policies with exclude_fields attribute selector
Get Policies with exclude_fields attribute selector
    Log    Get the list of existing policies, using fields
    Log    Get the list of existing policies, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?exclude_fields=${fields}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?exclude_fields=${fields}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}     
    Set Suite Variable    ${response}    ${output}     
@@ -464,7 +464,7 @@ Get Policies with exclude_fields attribute selector
Get Policies with exclude_default and fields attribute selector
Get Policies with exclude_default and fields attribute selector
    Log    Get the list of existing policies, using fields
    Log    Get the list of existing policies, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?fields=${fields}&exclude_default
    GET    ${apiRoot}/${apiName}/${apiVersion}/policies?fields=${fields}&exclude_default
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}