Commit 7e2c0f96 authored by aureliano sinatra's avatar aureliano sinatra
Browse files

refactoring fault management

parent 4d9bff7f
Loading
Loading
Loading
Loading
+105 −55
Original line number Original line Diff line number Diff line
@@ -8,97 +8,147 @@ Library OperatingSystem


*** Test Cases ***
*** Test Cases ***
POST Alarms - Method not implemented
POST Alarms - Method not implemented
    log    Trying to perform a PUT. This method should not be implemented
    [Documentation]    Test ID: 6.3.4.2.1
    Set Headers  {"Accept":"${ACCEPT}"}  
    ...    Test title: POST Alarms - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that the method is not implemented
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ...    Pre-conditions: 
    Log    Validate Status code
    ...    Reference: section 7.4.2.3.1 - SOL002 v2.4.1
    Integer    response status    405
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: none
    POST Alarms Task
    Check HTTP Response Status Code Is    405


Get information about multiple alarms 
Get information about multiple alarms 
    [Documentation]    Test ID: 7.4.2.1
    [Documentation]    Test ID: 6.3.4.2.2
    ...    Test title: Get information about multiple alarms
    ...    Test title: Get information about multiple alarms
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Pre-conditions: 
    ...    Pre-conditions: 
    ...    Reference: section 7.4.2 - SOL002 v2.4.1
    ...    Reference: section 7.4.2.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: 
    ...    Post-Conditions:  
    ...    Post-Conditions:  
    Log    Query VNF The GET method queries information about multiple alarms.
    GET Alarms Task
    Set Headers  {"Accept":"${ACCEPT}"}  
    Check HTTP Response Status Code Is    200
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Check HTTP Response Body Json Schema Is    alarms
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    Validate Json    alarms.schema.json    ${result}
    Log    Validation OK


Get information about multiple alarms with filters 
Get information about multiple alarms with filters 
    [Documentation]    Test ID: 7.4.2.2
    [Documentation]    Test ID: 6.3.4.2.3
    ...    Test title: Get information about multiple alarms - with filters
    ...    Test title: Get information about multiple alarms - with filters
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Pre-conditions: 
    ...    Pre-conditions: 
    ...    Reference: section 7.4.2 - SOL002 v2.4.1
    ...    Reference: section 7.4.2.3.3 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: 
    ...    Post-Conditions: 
    ...    Post-Conditions: 
    Log    Query VNF The GET method queries information about multiple alarms with filters.
    GET Alarms Task with filter
    Set Headers  {"Accept":"${ACCEPT}"}  
    Check HTTP Response Status Code Is    200
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Check HTTP Response Body Json Schema Is    alarms
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${managedObjectId} 
    Log    Validate Status code
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    Validate Json    alarms.schema.json    ${result}
    Log    Validation OK


Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters
Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters
    [Documentation]    Test ID: 7.4.2.2-1
    [Documentation]    Test ID: 6.3.4.2.4
    ...    Test title: Get information about multiple alarms - with Invalid attribute-based filtering parameters
    ...    Test title: Get information about multiple alarms - with Invalid attribute-based filtering parameters
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Pre-conditions: 
    ...    Pre-conditions: 
    ...    Reference: section 7.4.2 - SOL002 v2.4.1
    ...    Reference: section 7.4.2.3.4 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: 
    ...    Post-Conditions: 
    ...    Post-Conditions: 
    Log    Query VNF The GET method queries information about multiple alarm instances.
    GET Alarms Task with filter
    Set Headers  {"Accept":"${ACCEPT}"}  
    Check HTTP Response Status Code Is    400
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"} 
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${managedObjectId} 
    Log    Validate Status code
    Integer    response status    400
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    
    
PUT Alarms - Method not implemented
PUT Alarms - Method not implemented
    [Documentation]    Test ID: 6.3.4.2.5
    ...    Test title: PUT Alarms - Method not implemented
    ...    Test objective: The objective is to test that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.2.3.4 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: none
    PUT Alarms Task
    Check HTTP Response Status Code Is    405

PATCH Alarms - Method not implemented
    [Documentation]    Test ID: 6.3.4.2.6
    ...    Test title: PATCH Alarms - Method not implemented
    ...    Test objective: The objective is to test that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.2.3.5 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: none
    PATCH Alarms Task
    Check HTTP Response Status Code Is    405

DELETE Alarms - Method not implemented
    [Documentation]    Test ID: 6.3.4.2.7
    ...    Test title: DELETE Alarms - Method not implemented
    ...    Test objective: The objective is to test that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.2.3.6 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: none
    DELETE Alarms Task
    Check HTTP Response Status Code Is    405

*** Keywords ***
POST Alarms Task
    log    Trying to perform a POST. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
PUT Alarms Task
    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":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    ${outputResponse}=    Output    response
    Integer    response status    405
	Set Global Variable    @{response}    ${outputResponse}

PATCH Alarms Task
PATCH Alarms - Method not implemented
    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":"${AUTHORIZATION}"}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    ${outputResponse}=    Output    response
    Integer    response status    405
	Set Global Variable    @{response}    ${outputResponse}

DELETE Alarms Task
DELETE Alarms - Method not implemented
    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":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    ${outputResponse}=    Output    response
    Integer    response status    405
	Set Global Variable    @{response}    ${outputResponse}			
GET Alarms Task	
	Log    Query VNF The GET method queries information about multiple alarms.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
GET Alarms Task with filter
	Log    Query VNF The GET method queries information about multiple alarms with filters.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${managedObjectId} 
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}	
GET Alarms Task with invalid filter
	Log    Query VNF The GET method queries information about multiple alarms with filters.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${managedObjectId} 
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}	
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal    ${response.status_code}    ${expected_status}
    Log    Status code validated 
+79 −31
Original line number Original line Diff line number Diff line
@@ -5,54 +5,102 @@ Suite Setup Check resource existance


*** Test Cases ***
*** Test Cases ***
Escalate the perceived severity 
Escalate the perceived severity 
    [Documentation]    Test ID: 7.4.4.1
    [Documentation]    Test ID: 6.3.4.3.1
    ...    Test title: Escalate the perceived severity
    ...    Test title: Escalate the perceived severity
    ...    Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource.
    ...    Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource.
    ...    Pre-conditions: The resource representing the individual alarm has been created
    ...    Pre-conditions: The resource representing the individual alarm has been created
    ...    Reference: section 7.4.4 - SOL002 v2.4.1
    ...    Reference: section 7.4.4.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: 
    ...    Post-Conditions:   
    ...    Post-Conditions:   
    Post escalate severity
    Check HTTP Response Status Code Is    204
    
GET Escalate the perceived severity - Method not implemented
    [Documentation]    Test ID: 6.3.4.3.2
    ...    Test title: GET Escalate the perceived severity - Method not implemented
    ...    Test objective: to thest that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.4.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
    Get escalate severity
    Check HTTP Response Status Code Is    405

PUT Escalate the perceived severity - Method not implemented
    [Documentation]    Test ID: 6.3.4.3.3
    ...    Test title: PUT Escalate the perceived severity - Method not implemented
    ...    Test objective: to thest that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.4.3.3 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
    Put escalate severity
    Check HTTP Response Status Code Is    405
    
PATCH Escalate the perceived severity - Method not implemented
    [Documentation]    Test ID: 6.3.4.3.4
    ...    Test title: PATCH Escalate the perceived severity - Method not implemented
    ...    Test objective: to thest that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.4.3.4 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
    Put escalate severity
    Check HTTP Response Status Code Is    405
    
    
DELETE Escalate the perceived severity - Method not implemented
    [Documentation]    Test ID: 6.3.4.3.5
    ...    Test title: PATCH Escalate the perceived severity - Method not implemented
    ...    Test objective: to thest that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.4.3.5 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
    Delete escalate severity
    Check HTTP Response Status Code Is    405

*** Keywords ***
Check resource existance
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    Integer    response status    200
POST escalate severity
    Log    escalate the perceived severity of an alarm with the VNFM
    Log    escalate the perceived severity of an alarm with the VNFM
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate    ${PerceivedSeverity}
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate    ${PerceivedSeverity}
    Integer    response status    204
    ${outputResponse}=    Output    response
    Log    Status code validated
	Set Global Variable    @{response}    ${outputResponse}
   
GET escalate severity
GET Escalate the perceived severity - Method not implemented
    log    Trying to perform a GET. This method should not be implemented
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate 
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate 
    Log    Validate Status code
    ${outputResponse}=    Output    response
    Integer    response status    405
	Set Global Variable    @{response}    ${outputResponse} 

PUT escalate severity	
PUT Escalate the perceived severity - Method not implemented
	log    Trying to perform a PUT. This method should not be implemented
	log    Trying to perform a PUT. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate    
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate    
    Log    Validate Status code
     ${outputResponse}=    Output    response
    Integer    response status    405
	Set Global Variable    @{response}    ${outputResponse} 

PATCH escalate severity
PATCH Escalate the perceived severity - Method not implemented
    log    Trying to perform a PATCH. This method should not be implemented
    log    Trying to perform a PATCH. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate  
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate  
    Log    Validate Status code
     ${outputResponse}=    Output    response
    Integer    response status    405
	Set Global Variable    @{response}    ${outputResponse} 
    
DELETE escalate severity        
DELETE Escalate the perceived severity - Method not implemented
    log    Trying to perform a DELETE. This method should not be implemented
    log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate  
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate  
    Log    Validate Status code
     ${outputResponse}=    Output    response
    Integer    response status    405
	Set Global Variable    @{response}    ${outputResponse} 

 No newline at end of file
*** Keywords ***
Check resource existance
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    Integer    response status    200
+113 −85

File changed.

Preview size limit exceeded, changes collapsed.

+99 −43
Original line number Original line Diff line number Diff line
@@ -9,66 +9,122 @@ Suite Setup Check resource existance


*** Test Cases ***
*** Test Cases ***
Post Individual Subscription - Method not implemented
Post Individual Subscription - Method not implemented
    log    Trying to perform a POST. This method should not be implemented
    [Documentation]    Test ID: 6.3.4.5.1
    Set Headers  {"Accept":"${ACCEPT}"}
    ...    Test title: Post Individual Subscription - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that the method is not implemented
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}  
    ...    Pre-conditions: 
    Log    Validate Status code
    ...    Reference: section 7.4.6.3.1 - SOL002 v2.4.1
    Output    response
    ...    Config ID: Config_prod_VNFM
    Integer    response status    405
    ...    Applicability: 
    ...    Post-Conditions: 
    Post Create individual subscription
    Check HTTP Response Status Code Is    405
    
    
Get Information about an individual subscription
Get Information about an individual subscription
    [Documentation]    Test ID: 7.4.6.1
    [Documentation]    Test ID: 6.3.4.5.2
    ...    Test title: Retrieve the alarm subscriptions
    ...    Test title: Get Information about an individual subscription
    ...    Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client
    ...    Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client
    ...    Pre-conditions: The subscription with the given id exists
    ...    Pre-conditions: The subscription with the given id exists
    ...    Reference: section 7.4.6 - SOL002 v2.4.1
    ...    Reference: section 7.4.6.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  
    ...    Applicability:  
    ...    Post-Conditions: 
    ...    Post-Conditions: 
    log    Trying to get information about an individual subscription
    Get individual subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   FmSubscription

PUT an individual subscription - Method not implemented
    [Documentation]    Test ID: 6.3.4.5.3
    ...    Test title: Put Individual Subscription - Method not implemented
    ...    Test objective: The objective is to test that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.6.3.3 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    Put individual subscription
    Check HTTP Response Status Code Is    405
    

PATCH an individual subscription - Method not implemented
    [Documentation]    Test ID: 6.3.4.5.4
    ...    Test title: Patch Individual Subscription - Method not implemented
    ...    Test objective: The objective is to test that the method is not implemented
    ...    Pre-conditions: 
    ...    Reference: section 7.4.6.3.4 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    Patch individual subscription
    Check HTTP Response Status Code Is    405
    
    
DELETE an individual subscription
    [Documentation]    Test ID: 6.3.4.5.5
    ...    Test title: Delete an Individual Subscription
    ...    Test objective: The objective is to test that the deletion of a subscription
    ...    Pre-conditions: an existing subscription
    ...    Reference: section 7.4.6.3.5 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: the subscription is deleted
    Check resource existance
    Delete individual subscription
    Check HTTP Response Status Code Is    204
    
*** Keywords ***
Check resource existance
    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":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 
    Log    Validate Status code
    Integer    response status    200
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
Post Create individual subscription
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    log    Trying to perform a POST. This method should not be implemented
    ${result}=    Output    response body
    Set Headers  {"Accept":"${ACCEPT}"}
    Validate Json    FmSubscription.schema.json    ${result}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Validation OK
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}  

    ${outputResponse}=    Output    response
PUT an individual subscription - Method not implemented
	Set Global Variable    @{response}    ${outputResponse}				
Get individual subscription
    log    Trying to get information about an individual subscription
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}	
Get individual subscription - filter
    Log    Get the list of active individual subscription using a filter
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}		
Get individual subscription - invalid filter  
    Log    Get the list of active individual subscription using an invalid filter
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}		
PUT individual subscription
    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":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}        
    Put    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}        
    Log    Validate Status code
    ${outputResponse}=    Output    response
    Output    response
	Set Global Variable    @{response}    ${outputResponse}	
    Integer    response status    405
PATCH individual subscription

PATCH an individual subscription - Method not implemented
    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}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 
    Patch    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 
    Log    Validate Status code
    ${outputResponse}=    Output    response
    Output    response
	Set Global Variable    @{response}    ${outputResponse}		
    Integer    response status    405
DELETE individual subscription
    
DELETE an individual subscription
    log    Try to delete an individual subscription
    log    Try to delete an individual subscription
    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":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}    	   
    Delete    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}    	   
    Log    Validate Status code
    ${outputResponse}=    Output    response
    Output    response
	Set Global Variable    @{response}    ${outputResponse}	      
    Integer    response status    204
 No newline at end of file

*** Keywords ***
Check resource existance
    Set Headers    {"Accept":"${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 
    Integer    response status    200
 No newline at end of file
+129 −98

File changed.

Preview size limit exceeded, changes collapsed.

Loading