Commit c4c4a6b5 authored by Ranim Naimi's avatar Ranim Naimi
Browse files

two tcs : throttling conjuction with timeInterval and negative throttling

parent d67da146
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that you cannot create a subscription with timeInterval and throttling
Documentation       Check that you cannot create a subscription with negative/in conjunction with timeInterval throttling

Resource            ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource

Test Template       Create Subscription With TimeInterval And Throttling


*** Variables ***
${subscription_payload_file_path}=      subscriptions/subscription-throttling-timeInterval-sample.jsonld
Test Template       Create Subscription With Different Requests


*** Test Cases ***    FILENAME    EXPECTED_STATUS
028_05_01 InvalidJson
    subscription-throttling-timeInterval-sample.jsonld    ${ERROR_TYPE_BAD_REQUEST_DATA}
028_05_01 ThrottlingAndTimeIntervalConjunction
    subscription-throttling-timeInterval-invalid-sample.jsonld    ${ERROR_TYPE_BAD_REQUEST_DATA}
028_05_02 NegativeThrottling
    subscription-negative-throttling-sample.jsonld    ${ERROR_TYPE_BAD_REQUEST_DATA}


*** Keywords ***
Create Subscription With TimeInterval And Throttling
    [Documentation]    Check that you cannot create a subscription with timeInterval and throttling
Create Subscription With Different Requests
    [Documentation]    Check that you cannot create a subscription with negative/in conjunction with timeInterval throttling
    [Tags]    sub-create    5_8_1
    [Arguments]    ${subscription_payload_file_path}    ${expected_status}
    ${response}=    Create Subscription From File    ${subscription_payload_file_path}
    [Arguments]    ${filename}    ${expected_status}
    ${response}=    Create Subscription From File    ${filename}
    Check Response Status Code    400    ${response.status_code}
    Check RL Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()}
+20 −0
Original line number Diff line number Diff line
{
   "id":"urn:ngsi-ld:Subscription:randomUUID",
   "type":"Subscription",
   "entities":[
      {
         "type":"Building"
      }
   ],
   "notification":{
      "format":"keyValues",
      "endpoint":{
         "uri":"http://my.endpoint.org/notify",
         "accept":"application/json"
      }
   },
   "throttling" : -30,
   "@context":[
      "https://easy-global-market.github.io/ngsild-api-data-models/ngsi-ld-test-suite/ngsi-ld-test-suite-compound-v1.7.jsonld"
   ]
}
 No newline at end of file