From a54f9a24f34904fffb973da8b6936ea27dd8f521 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Wed, 18 Dec 2024 12:48:08 +0545 Subject: [PATCH 1/2] add test for checking the response of ocm .well-known endpoint Signed-off-by: nabim777 --- .../features/apiOcm/ocmEndpoint.feature | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tests/acceptance/features/apiOcm/ocmEndpoint.feature diff --git a/tests/acceptance/features/apiOcm/ocmEndpoint.feature b/tests/acceptance/features/apiOcm/ocmEndpoint.feature new file mode 100644 index 0000000000..bf52762a78 --- /dev/null +++ b/tests/acceptance/features/apiOcm/ocmEndpoint.feature @@ -0,0 +1,84 @@ +@ocm +Feature: OCM Well-Known Endpoint + As a user + I want to verify the response of the .well-known/ocm endpoint + So that I can ensure the configuration works correctly + + + Scenario: check the ocm well-known endpoint response + Given using server "LOCAL" + When a user requests "/.well-known/ocm" with "GET" and no authentication + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "enabled", + "apiVersion", + "endPoint", + "provider", + "resourceTypes", + "capabilities" + ], + "properties": { + "enabled": { + "const": true + }, + "apiVersion": { + "const": "1.1.0" + }, + "endPoint": { + "pattern": "^%base_url%/ocm" + }, + "provider": { + "const": "oCIS" + }, + "resourceTypes": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "name", + "shareTypes", + "protocols" + ], + "properties": { + "name": { + "const": "file" + }, + "sharesTypes": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "const": "user" + } + }, + "protocols": { + "type": "object", + "required": [ + "webdav" + ], + "properties": { + "webdav": { + "const": "/dav/ocm" + } + } + } + } + } + }, + "capabilities": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "const": "/invite-accepted" + } + } + } + } + """ From f8a55b68415838552adb0ef2db1963e0d5afe379 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 19 Dec 2024 14:23:30 +0545 Subject: [PATCH 2/2] review address Signed-off-by: nabim777 --- tests/acceptance/features/apiOcm/ocmEndpoint.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/apiOcm/ocmEndpoint.feature b/tests/acceptance/features/apiOcm/ocmEndpoint.feature index bf52762a78..f40ae7a879 100644 --- a/tests/acceptance/features/apiOcm/ocmEndpoint.feature +++ b/tests/acceptance/features/apiOcm/ocmEndpoint.feature @@ -1,7 +1,7 @@ @ocm -Feature: OCM Well-Known Endpoint +Feature: ocm well-known URI As a user - I want to verify the response of the .well-known/ocm endpoint + I want to verify the response of well-known URI So that I can ensure the configuration works correctly