Commit dec21aa0 authored by Najam UI Hassan's avatar Najam UI Hassan Committed by Giacomo Bernini
Browse files

added testcases for Subscription filter parameter

parent baddf9da
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ GET Individual Subscription - invalid resource identifier
    ...    Post-Conditions: none
    GET individual Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

DELETE Individual Subscription
    [Documentation]    Test ID: 8.3.4.6.3
+24 −0
Original line number Diff line number Diff line
@@ -418,6 +418,30 @@ Get Subscriptions with invalid attribute-based filters
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get subscriptions with filter "id"
    Log    Get the list of active subscriptions using a filter "id"
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?id=${subscription_id}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body Subscription Matches the requested attribute-based filter "id"
    Should Be Equal As Strings    ${response['body']['id']}    ${subscription_id}
	
Get subscriptions with filter "filter_notificationTypes"
    Log    Get the list of active subscriptions using a filter "filter.notificationTypes"
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.notificationTypes=${notification_type}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_notificationTypes"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['filter']['notificationTypes']}   ${notification_type}
    END

Send Post Request for Subscription
    Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
+36 −8
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ GET Subscriptions - invalid attribute-based filter
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   ProblemDetails 


GET Subscriptions - Bad Request Response too Big
    [Documentation]    Test ID: 8.3.4.5.5
    ...    Test title: GET Subscriptions - Bad Request Response too Big
@@ -88,12 +87,41 @@ GET Subscriptions - invalid resource endpoint
    ...    Post-Conditions: none    
    Get all Subscriptions
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
GET Subscription with attribute-based filter "id"
    [Documentation]    Test ID: 8.3.4.5.7
    ...    Test title: GET Subscription with attribute-based filter "id"
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter "id"
    ...    Pre-conditions: none 
    ...    Reference: clause 8.5.7.3.2 - ETSI GS NFV-SOL 009 [6] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability:  none 
    ...    Post-Conditions: none 
    Get subscriptions with filter "id"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   LogmSubscription
    Check PostCondition HTTP Response Body Subscription Matches the requested attribute-based filter "id"
    
Get subscriptions with filter "filter.notificationTypes"
    [Documentation]    Test ID: 8.3.4.5.8
    ...    Test title: GET Subscription with attribute-based filter "filter.notificationTypes"
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.notificationTypes"
    ...    Pre-conditions: none 
    ...    Reference: clause 8.5.7.3.2 - ETSI GS NFV-SOL 009 [6] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability:  none 
    ...    Post-Conditions: none 
    Get subscriptions with filter "filter_notificationTypes"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   LogmSubscriptions 
    Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_notificationTypes"
    
Create new Subscription
    [Documentation]    Test ID 8.3.4.5.7
    [Documentation]    Test ID 8.3.4.5.9
    ...    Test title: Create new Subscription
    ...    Test objective: The objective is to test the creation of a new subscription to log management notification and perform a JSON schema and content validation of the returned subscription data structure
    ...    Pre-conditions: 
    ...    Pre-conditions: none
    ...    Reference: clause 8.5.7.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
@@ -106,7 +134,7 @@ Create new Subscription

Create request for duplicated Subscription not creating duplicated subscriptions
    [Tags]    no-duplicated-subs
    [Documentation]    Test ID 8.3.4.5.8
    [Documentation]    Test ID 8.3.4.5.10
    ...    Test title: Create request for duplicated Subscription not creating duplicated subscriptions
    ...    Test objective: The objective is to test the attempt of a creation of a duplicated subscription failed and check that no new subscription is created and a link to the original subscription is returned
    ...    Pre-conditions: At least one subscription is available in the NFV-MANO.
@@ -122,7 +150,7 @@ Create request for duplicated Subscription not creating duplicated subscriptions

Create request for duplicated Subscription creating duplicated subscriptions
    [Tags]    duplicated-subs
    [Documentation]    Test ID 8.3.4.5.9
    [Documentation]    Test ID 8.3.4.5.11
    ...    Test title: Create request for duplicated Subscription creating duplicated subscriptions
    ...    Test objective: The objective is to test the creation of a duplicated subscription and perform a JSON schema and content validation of the returned duplicated subscription data structure
    ...    Pre-conditions: At least one subscription is available in the NFV-MANO.
@@ -137,7 +165,7 @@ Create request for duplicated Subscription creating duplicated subscriptions
    Check Postcondition Subscription Is Set 

PUT Subscriptions - Method not implemented
    [Documentation]    Test ID 8.3.4.5.10
    [Documentation]    Test ID 8.3.4.5.12
    ...    Test title: PUT Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify subscriptions
    ...    Pre-conditions: none
@@ -149,7 +177,7 @@ PUT Subscriptions - Method not implemented
    Check HTTP Response Status Code Is    405 
    
PATCH Subscriptions - Method not implemented
    [Documentation]    Test ID 8.3.4.5.11
    [Documentation]    Test ID 8.3.4.5.13
    ...    Test title: PATCH Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update subscriptions
    ...    Pre-conditions: none
@@ -161,7 +189,7 @@ PATCH Subscriptions - Method not implemented
    Check HTTP Response Status Code Is    405
    
DELETE Subscriptions - Method not implemented
    [Documentation]    Test ID 8.3.4.5.12
    [Documentation]    Test ID 8.3.4.5.14
    ...    Test title: DELETE Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete subscriptions
    ...    Pre-conditions: none
+2 −1
Original line number Diff line number Diff line
@@ -63,3 +63,4 @@ ${erroneousSubscriptionId} erroneousSubscriptionId
${newSubscriptionId}    newSubsciptionId

${objectInstanceId}     4bd7-94b4-6bbb86-9c79aa
${notification_type}    LogReportAvailableNotification
 No newline at end of file