Skip to content

Commit

Permalink
Merge pull request #651 from catenax-ng/fix/#503-Fix-tests-Tavern-Cuc…
Browse files Browse the repository at this point in the history
…umber-Tests

Fix/#503 fix tests tavern cucumber tests
  • Loading branch information
ds-jhartmann authored May 16, 2024
2 parents 6dfc3b1 + 6a375c5 commit 2696589
Showing 1 changed file with 110 additions and 109 deletions.
219 changes: 110 additions & 109 deletions local/testing/api-tests/irs-api-tests.tavern.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
collectAspects: true
depth: 2
Expand Down Expand Up @@ -1239,7 +1239,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d # "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c # "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
collectAspects: true
depth: 1
Expand Down Expand Up @@ -1390,7 +1390,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: "urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c" #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
aspects:
- urn:samm:io.catenax.serial_part:3.0.0#SerialPart
Expand Down Expand Up @@ -1449,7 +1449,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
aspects:
# - urn:samm:io.catenax.serial_part:3.0.0#SerialPart
Expand Down Expand Up @@ -1511,7 +1511,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: "urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d"
globalAssetId: "urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c"
bpn: "BPNL00000003AVTH"
aspects:
- urn:samm:io.catenax.material_for_recycling:1.1.0#MaterialForRecycling
Expand Down Expand Up @@ -1570,7 +1570,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: "urn:uuid:622f4933-e02b-436c-9194-9e5bb71a45e2" #"urn:uuid:397b63ae-89d7-4131-b45a-575e840dc5c5"
globalAssetId: "urn:uuid:4c9bbfb1-414c-4c55-b197-3b3958d73ea1" #"urn:uuid:397b63ae-89d7-4131-b45a-575e840dc5c5"
bpn: "BPNL00000003AVTH"
aspects:
- urn:samm:io.catenax.batch:3.0.0#Batch
Expand Down Expand Up @@ -1630,7 +1630,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: "urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
aspects:
- urn:samm:io.catenax.serial_part:3.0.0#SerialPart
Expand Down Expand Up @@ -1725,12 +1725,12 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: "urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c" #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
aspects:
- urn:samm:io.catenax.serial_part:3.0.0#SerialPart
- urn:samm:io.catenax.batch:3.0.0#Batch
- urn:samm:io.catenax.material_for_recycling:1.1.0#MaterialForRecycling
# - urn:samm:io.catenax.batch:3.0.0#Batch
# - urn:samm:io.catenax.material_for_recycling:1.1.0#MaterialForRecycling
#- urn:samm:io.catenax.single_level_usage_as_built:3.0.0#SingleLevelUsageAsBuilt
#- urn:samm:io.catenax.battery.battery_pass:3.0.1#BatteryPass"
#- urn:samm:io.catenax.market_place_offer:1.4.0#MarketPlaceOffer
Expand Down Expand Up @@ -1826,7 +1826,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
aspects:
- urn:samm:io.catenax.serial_part:3.0.0#SerialPart
Expand Down Expand Up @@ -2508,108 +2508,109 @@ stages:

---

# lookupBPNs are deprecated and no longer used
# test_name: Make sure IRS-jobs are running without BPN-lookups by default

# 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: false
# depth: 1
# direction: "downward"
# method: POST
# headers:
# content-type: application/json
# $ext:
# function: local.testing.api-tests.tavern_helpers:create_api_key
# response:
# status_code: 201
# headers:
# content-type: application/json
# save:
# json:
# job_id: id

test_name: Make sure IRS-jobs are running without BPN-lookups by default

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: false
depth: 1
direction: "downward"
method: POST
headers:
content-type: application/json
$ext:
function: local.testing.api-tests.tavern_helpers:create_api_key
response:
status_code: 201
headers:
content-type: application/json
save:
json:
job_id: id

- *verify_job_is_running_and_wait_up_to_15_minutes_for_COMPLETED
# - *verify_job_is_running_and_wait_up_to_15_minutes_for_COMPLETED

- name: verify job response with desired test steps
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_api_key
response:
status_code: 200
verify_response_with:
- function: local.testing.api-tests.tavern_helpers:bpns_are_empty
headers:
content-type: application/json
# - name: verify job response with desired test steps
# 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_api_key
# response:
# status_code: 200
# verify_response_with:
# - function: local.testing.api-tests.tavern_helpers:bpns_are_empty
# headers:
# content-type: application/json


---


test_name: Make sure IRS-jobs are running with BPN-lookups correctly

strict:
- headers:off
- json:off

stages:
- name: create a job and wait
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: false
depth: 1
direction: "downward"
method: POST
headers:
content-type: application/json
$ext:
function: local.testing.api-tests.tavern_helpers:create_api_key
response:
status_code: 201
headers:
content-type: application/json
save:
json:
job_id: id

- *verify_job_is_running_and_wait_up_to_15_minutes_for_COMPLETED

- name: verify job response with desired test steps
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_api_key
response:
status_code: 200
verify_response_with:
- function: local.testing.api-tests.tavern_helpers:bpns_are_not_empty
headers:
content-type: application/json
# lookupBPNs are deprecated and no longer used
#test_name: Make sure IRS-jobs are running with BPN-lookups correctly
#
#strict:
# - headers:off
# - json:off
#
#stages:
# - name: create a job and wait
# 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: false
# lookupBPNs: false
# depth: 1
# direction: "downward"
# method: POST
# headers:
# content-type: application/json
# $ext:
# function: local.testing.api-tests.tavern_helpers:create_api_key
# response:
# status_code: 201
# headers:
# content-type: application/json
# save:
# json:
# job_id: id
#
# - *verify_job_is_running_and_wait_up_to_15_minutes_for_COMPLETED
#
# - name: verify job response with desired test steps
# 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_api_key
# response:
# status_code: 200
# verify_response_with:
# - function: local.testing.api-tests.tavern_helpers:bpns_are_not_empty
# headers:
# content-type: application/json


---
Expand Down Expand Up @@ -3197,7 +3198,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: "urn:uuid:835eed75-8556-4d36-aae0-b3c550096af3" #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: "urn:uuid:3f4da38c-d1d0-4324-bda8-4a48fffef019" #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
collectAspects: true
auditContractNegotiation: true
Expand Down Expand Up @@ -3254,7 +3255,7 @@ stages:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
key:
globalAssetId: "urn:uuid:835eed75-8556-4d36-aae0-b3c550096af3" #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
globalAssetId: "urn:uuid:3f4da38c-d1d0-4324-bda8-4a48fffef019" #"{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILT}"
bpn: "{tavern.env_vars.BPN_AS_BUILT}"
collectAspects: true
auditContractNegotiation: false
Expand Down

0 comments on commit 2696589

Please sign in to comment.