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

tc for throttling in subscription : can't create a sub with throttling and timeInterval

parent df5663c6
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that you cannot create a subscription with timeInterval and 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 Cases ***    FILENAME    EXPECTED_STATUS
028_05_01 InvalidJson
    subscription-throttling-timeInterval-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
    [Tags]    sub-create    5_8_1
    [Arguments]    ${subscription_payload_file_path}    ${expected_status}
    ${response}=    Create Subscription From File    ${subscription_payload_file_path}
    Check Response Status Code    400    ${response.status_code}
    Check RL Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()}
    ...    ${expected_status}
    Check RL Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
+21 −0
Original line number Diff line number Diff line
{
   "id":"urn:ngsi-ld:Subscription:randomUUID",
   "type":"Subscription",
   "timeInterval": 10,
   "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