From b56e4adb22b86101f64823fccd863ae6c3fc5436 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 6 Aug 2026 21:31:20 +0300 Subject: [PATCH] tests in root --- Create Release.yml | 33 ++++++++++++++++++++ Create Service Without Body.yml | 48 +++++++++++++++++++++++++++++ Create Service Without Code.yml | 52 ++++++++++++++++++++++++++++++++ Create Service.yml | 53 +++++++++++++++++++++++++++++++++ Get All Services.yml | 15 ++++++++++ Get Service by Code.yml | 15 ++++++++++ Get Service by ID.yml | 15 ++++++++++ Negative - Invalid UUID.yml | 15 ++++++++++ Negative - Missing Body.yml | 21 +++++++++++++ Update Release.yml | 26 ++++++++++++++++ Update Service.yml | 26 ++++++++++++++++ opencollection.yml | 23 ++++++++++++++ 12 files changed, 342 insertions(+) create mode 100644 Create Release.yml create mode 100644 Create Service Without Body.yml create mode 100644 Create Service Without Code.yml create mode 100644 Create Service.yml create mode 100644 Get All Services.yml create mode 100644 Get Service by Code.yml create mode 100644 Get Service by ID.yml create mode 100644 Negative - Invalid UUID.yml create mode 100644 Negative - Missing Body.yml create mode 100644 Update Release.yml create mode 100644 Update Service.yml create mode 100644 opencollection.yml diff --git a/Create Release.yml b/Create Release.yml new file mode 100644 index 0000000..3ba7bbe --- /dev/null +++ b/Create Release.yml @@ -0,0 +1,33 @@ +info: + name: Create Release + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/api/v1/releases" + headers: + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "service": "e58ac01a-606b-4cf7-9dee-cb4484672fa1", + "version": "1.0.0", + "changelog": "Initial release" + } + auth: inherit + +runtime: + scripts: + - type: after-response + code: "let json = res.getBody();\r + + bru.setEnvVar('releaseId', json.data.id);" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Create Service Without Body.yml b/Create Service Without Body.yml new file mode 100644 index 0000000..8c94c05 --- /dev/null +++ b/Create Service Without Body.yml @@ -0,0 +1,48 @@ +info: + name: Create Service Without Body + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/v1/services" + headers: + - name: Content-Type + value: application/json + - name: requestID + value: test-req-1 + body: + type: json + data: "" + auth: inherit + +runtime: + scripts: + - type: after-response + code: "test('Status code is 200', function () {\r + + \ expect(res.getStatus()).to.equal(200);\r + + });\r + + \r + + let json = res.getBody();\r + + \r + + test('Status is SUCCESS', function () {\r + + \ expect(json.status).to.eql('SUCCESS');\r + + });\r + + \r + + bru.setEnvVar('serviceId', json.data.id);" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Create Service Without Code.yml b/Create Service Without Code.yml new file mode 100644 index 0000000..10c3327 --- /dev/null +++ b/Create Service Without Code.yml @@ -0,0 +1,52 @@ +info: + name: Create Service Without Code + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/v1/services" + headers: + - name: Content-Type + value: application/json + - name: requestID + value: test-req-1 + body: + type: json + data: |- + { + "type": "SYSTEM", + "name": "Сервис управления версиями модулей" + } + auth: inherit + +runtime: + scripts: + - type: after-response + code: "test('Status code is 200', function () {\r + + \ expect(res.getStatus()).to.equal(200);\r + + });\r + + \r + + let json = res.getBody();\r + + \r + + test('Status is SUCCESS', function () {\r + + \ expect(json.status).to.eql('SUCCESS');\r + + });\r + + \r + + bru.setEnvVar('serviceId', json.data.id);" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Create Service.yml b/Create Service.yml new file mode 100644 index 0000000..8e129a8 --- /dev/null +++ b/Create Service.yml @@ -0,0 +1,53 @@ +info: + name: Create Service + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/v1/services" + headers: + - name: Content-Type + value: application/json + - name: requestID + value: test-req-1 + body: + type: json + data: |- + { + "type": "SYSTEM", + "code": "SERVICE_1", + "name": "Test Service" + } + auth: inherit + +runtime: + scripts: + - type: after-response + code: "test('Status code is 200', function () {\r + + \ expect(res.getStatus()).to.equal(200);\r + + });\r + + \r + + let json = res.getBody();\r + + \r + + test('Status is SUCCESS', function () {\r + + \ expect(json.status).to.eql('SUCCESS');\r + + });\r + + \r + + bru.setEnvVar('serviceId', json.data.id);" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Get All Services.yml b/Get All Services.yml new file mode 100644 index 0000000..1bda34d --- /dev/null +++ b/Get All Services.yml @@ -0,0 +1,15 @@ +info: + name: Get All Services + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/v1/services" + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Get Service by Code.yml b/Get Service by Code.yml new file mode 100644 index 0000000..6042353 --- /dev/null +++ b/Get Service by Code.yml @@ -0,0 +1,15 @@ +info: + name: Get Service by Code + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/v1/services/code/modules-version2.2" + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Get Service by ID.yml b/Get Service by ID.yml new file mode 100644 index 0000000..34518bf --- /dev/null +++ b/Get Service by ID.yml @@ -0,0 +1,15 @@ +info: + name: Get Service by ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/v1/services/{{serviceId}}" + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Negative - Invalid UUID.yml b/Negative - Invalid UUID.yml new file mode 100644 index 0000000..2e4ef54 --- /dev/null +++ b/Negative - Invalid UUID.yml @@ -0,0 +1,15 @@ +info: + name: Negative - Invalid UUID + type: http + seq: 10 + +http: + method: GET + url: "{{baseUrl}}/api/v1/services/123" + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Negative - Missing Body.yml b/Negative - Missing Body.yml new file mode 100644 index 0000000..88afe1b --- /dev/null +++ b/Negative - Missing Body.yml @@ -0,0 +1,21 @@ +info: + name: Negative - Missing Body + type: http + seq: 11 + +http: + method: POST + url: "{{baseUrl}}/api/v1/services" + headers: + - name: Content-Type + value: application/json + body: + type: json + data: "" + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Update Release.yml b/Update Release.yml new file mode 100644 index 0000000..e37a470 --- /dev/null +++ b/Update Release.yml @@ -0,0 +1,26 @@ +info: + name: Update Release + type: http + seq: 9 + +http: + method: PUT + url: "{{baseUrl}}/api/v1/releases/{{releaseId}}" + headers: + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "service": "{{serviceId}}", + "version": "1.0.1", + "changelog": "Bug fixes" + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/Update Service.yml b/Update Service.yml new file mode 100644 index 0000000..fb48ce3 --- /dev/null +++ b/Update Service.yml @@ -0,0 +1,26 @@ +info: + name: Update Service + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/v1/services/{{serviceId}}" + headers: + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "code": "modules-version2.2", + "name": "Сервис управления версиями модулей", + "type": "SYSTEM" + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 diff --git a/opencollection.yml b/opencollection.yml new file mode 100644 index 0000000..7d666c3 --- /dev/null +++ b/opencollection.yml @@ -0,0 +1,23 @@ +opencollection: 1.0.0 + +info: + name: Services API + +request: + variables: + - name: baseUrl + value: http://modules.dev.practic.ordocrm.online + - name: serviceId + value: "" + - name: releaseId + value: "" + +docs: + content: Collection for Services & Releases API testing + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git