From 5ebc0c9d84b955ab41e27b549d98bb363e5dd4f9 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 16 Nov 2023 13:33:13 +0100 Subject: [PATCH] feat(impl):[279] adjusted and added tavern test for http code 206 --- .../api-tests/irs-api-tests.tavern.yaml | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/local/testing/api-tests/irs-api-tests.tavern.yaml b/local/testing/api-tests/irs-api-tests.tavern.yaml index d8127916c8..0b3c7ce37d 100644 --- a/local/testing/api-tests/irs-api-tests.tavern.yaml +++ b/local/testing/api-tests/irs-api-tests.tavern.yaml @@ -607,6 +607,58 @@ stages: --- +test_name: Make sure job with status RUNNING is responsed with http code 206 + +strict: + - headers:off + - json:off + +stages: + - name: create a job and check for success + request: + url: "{tavern.env_vars.IRS_HOST}/irs/jobs" + json: + key: + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}" + bpn: "{tavern.env_vars.BPN_AS_BUILT}" + collectAspects: true + depth: 2 + aspects: + - SerialPart + direction: "downward" + method: POST + headers: + content-type: application/json + $ext: + function: local.testing.api-tests.tavern_helpers:create_bearer_token + response: + status_code: 201 + headers: + content-type: application/json + save: + json: + job_id: id + + - name: verify running job is responsed with http code 206 + request: + url: "{tavern.env_vars.IRS_HOST}/irs/jobs/{job_id}" + params: + returnUncompletedJob: true + method: GET + headers: + content-type: application/json + $ext: + function: local.testing.api-tests.tavern_helpers:create_bearer_token + response: + status_code: 206 + json: + job: + state: RUNNING + + +--- + + test_name: Make sure job with submodels process with status COMPLETED with asPlanned-id strict: @@ -1275,7 +1327,7 @@ stages: $ext: function: local.testing.api-tests.tavern_helpers:create_bearer_token response: - status_code: 200 + status_code: 206 json: job: state: RUNNING