From ddf007ac517c0c5caba9d8fa6a4315be9404fb5a Mon Sep 17 00:00:00 2001 From: Elian Kraja Date: Sun, 8 Sep 2019 20:52:40 +0200 Subject: [PATCH] Added example of empty schema working with a non empty json --- SRV/AMS/AMSService.robot | 8 ++++---- examples/emptyschema/EmptySchema.robot | 12 ++++++++++++ examples/emptyschema/jsons/test.json | 4 ++++ examples/emptyschema/schemas/EmptySchema.json | 7 +++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 examples/emptyschema/EmptySchema.robot create mode 100644 examples/emptyschema/jsons/test.json create mode 100644 examples/emptyschema/schemas/EmptySchema.json diff --git a/SRV/AMS/AMSService.robot b/SRV/AMS/AMSService.robot index 5184760..db9e974 100644 --- a/SRV/AMS/AMSService.robot +++ b/SRV/AMS/AMSService.robot @@ -45,7 +45,7 @@ Register a new application mobility services [Documentation] TP_MEC_SRV_AMS_002_OK ... Check that the AMS service creates a new application mobility services when requested ... ETSI GS MEC 021 2.0.8, clause 8.3.3.4 - Create a new application mobility service RegistrationRequest + Create a new application mobility service RegistrationInfo Check HTTP Response Status Code Is 201 Check HTTP Response Body Json Schema Is AppMobilityServiceInfo Log Checking Postcondition @@ -56,7 +56,7 @@ Register an UE Identity Tag using invalid parameter [Documentation] TP_MEC_SRV_AMS_002_BR ... Check that the AMS service sends an error when it receives a malformed request to create a new application mobility service ... ETSI GS MEC 021 2.0.8, clause 8.3.3.4 - Create a new application mobility service RegistrationRequestMalformed + Create a new application mobility service RegistrationInfoMalformed Check HTTP Response Status Code Is 400 @@ -69,7 +69,7 @@ Request Subscriptions List for the registered AMS services ... ETSI GS MEC 021 2.0.8, clause 8.6.3.1 Get Subscriptions for registered AMS Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is SubscriptionLinks + Check HTTP Response Body Json Schema Is SubscriptionLinkList @@ -218,7 +218,7 @@ Post Expire Notification ... Check that the AMS service sends an AMS notification on subscription expiration ... if the AMS service has an associated subscription and the event is generated ... ETSI GS MEC 021 2.0.8, clause 7.4.4 - ${json}= Get File schemas/ExpireNotification.schema.json + ${json}= Get File schemas/ExpiryNotification.schema.json Log Creating mock request and response to handle Expire Notification &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${json} &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 diff --git a/examples/emptyschema/EmptySchema.robot b/examples/emptyschema/EmptySchema.robot new file mode 100644 index 0000000..b0707ab --- /dev/null +++ b/examples/emptyschema/EmptySchema.robot @@ -0,0 +1,12 @@ +*** Settings *** +Library BuiltIn +Library OperatingSystem +Library JSONSchemaLibrary schemas/ + + + +*** Test Cases *** +Testing Empty Schema Validation + ${object}= Get File jsons/test.json + ${json}= Evaluate json.loads('''${object}''') json + Validate Json EmptySchema.json ${json} diff --git a/examples/emptyschema/jsons/test.json b/examples/emptyschema/jsons/test.json new file mode 100644 index 0000000..dd2e7ae --- /dev/null +++ b/examples/emptyschema/jsons/test.json @@ -0,0 +1,4 @@ +{ + "test": "empty schema test", + "result": "should work with this json" +} \ No newline at end of file diff --git a/examples/emptyschema/schemas/EmptySchema.json b/examples/emptyschema/schemas/EmptySchema.json new file mode 100644 index 0000000..7f2c48b --- /dev/null +++ b/examples/emptyschema/schemas/EmptySchema.json @@ -0,0 +1,7 @@ +{ + "type": "object", + "properties": { + + }, + "required": [] +} \ No newline at end of file -- GitLab