-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #546 from FraunhoferISST/feat/bruno_int_collection
feat: add bruno int test collection
- Loading branch information
Showing
55 changed files
with
3,439 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Add New Site to Supplier Partner.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
meta { | ||
name: Add New Site to Supplier Partner | ||
type: http | ||
seq: 6 | ||
} | ||
|
||
put { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/partners/putSite?partnerBpnl={{SUPPLIER_BPNL}} | ||
body: json | ||
auth: none | ||
} | ||
|
||
params:query { | ||
partnerBpnl: {{SUPPLIER_BPNL}} | ||
} | ||
|
||
headers { | ||
Content-Type: application/json | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"bpns": "{{SUPPLIER_BPNS2}}", | ||
"name": "Semiconductor Supplier Inc. Secondary Site", | ||
"addresses": [ | ||
{ | ||
"bpna": "{{SUPPLIER_BPNA2}}", | ||
"streetAndNumber": "Sunset Blvd. 345", | ||
"zipCodeAndCity": "90001 Los Angeles", | ||
"country": "USA" | ||
} | ||
] | ||
} | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
...uris-integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Create Control Unit Product.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
meta { | ||
name: Create Control Unit Product | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
post { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/materials | ||
body: json | ||
auth: none | ||
} | ||
|
||
headers { | ||
Content-Type: application/json | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"materialFlag": false, | ||
"productFlag": true, | ||
"ownMaterialNumber": "MNR-4177-S", | ||
"materialNumberCx": null, | ||
"name": "Central Control Unit" | ||
} | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
} |
38 changes: 38 additions & 0 deletions
38
...integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Create Material Partner Relation.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
meta { | ||
name: Create Material Partner Relation | ||
type: http | ||
seq: 8 | ||
} | ||
|
||
post { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{SUPPLIER_BPNL}}&ownMaterialNumber={{B64_MNR_CUSTOMER}}&partnerMaterialNumber={{B64_MNR_SUPPLIER}}&partnerSupplies=true&partnerBuys=false | ||
body: none | ||
auth: none | ||
} | ||
|
||
params:query { | ||
partnerBpnl: {{SUPPLIER_BPNL}} | ||
ownMaterialNumber: {{B64_MNR_CUSTOMER}} | ||
partnerMaterialNumber: {{B64_MNR_SUPPLIER}} | ||
partnerSupplies: true | ||
partnerBuys: false | ||
} | ||
|
||
headers { | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
script:pre-request { | ||
var plain = bru.getEnvVar("MATERIAL_NUMBER_CUSTOMER") | ||
var encoded = Buffer.from(plain).toString("base64") | ||
bru.setVar("B64_MNR_CUSTOMER", encoded) | ||
var plain = bru.getEnvVar("MATERIAL_NUMBER_SUPPLIER") | ||
var encoded = Buffer.from(plain).toString("base64") | ||
bru.setVar("B64_MNR_SUPPLIER", encoded) | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
} |
32 changes: 32 additions & 0 deletions
32
...is-integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Create Semiconductor Material.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
meta { | ||
name: Create Semiconductor Material | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/materials | ||
body: json | ||
auth: none | ||
} | ||
|
||
headers { | ||
Content-Type: application/json | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"materialFlag": true, | ||
"productFlag": false, | ||
"ownMaterialNumber": "{{MATERIAL_NUMBER_CUSTOMER}}", | ||
"materialNumberCx": "{{MATERIAL_NUMBER_CX}}", | ||
"name": "Semiconductor" | ||
} | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
} |
41 changes: 41 additions & 0 deletions
41
local/bruno/puris-integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Get All Materials.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
meta { | ||
name: Get All Materials | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
get { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/materials/all | ||
body: none | ||
auth: none | ||
} | ||
|
||
headers { | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
|
||
test("Verify response contains two objects", function () { | ||
expect(res.getBody()).to.be.an("array").with.lengthOf(2); | ||
}); | ||
|
||
test("Verify ownMaterialNumber values", function () { | ||
const responseJson = res.getBody(); | ||
|
||
const foundValues = []; | ||
|
||
responseJson.forEach(function (obj) { | ||
expect(obj).to.have.property("ownMaterialNumber"); | ||
expect(obj.ownMaterialNumber).to.be.oneOf(["MNR-4177-S", bru.getEnvVar("MATERIAL_NUMBER_CUSTOMER")]); | ||
|
||
// Put found value into foundValues to ensure that each value is only found once | ||
expect(foundValues).to.not.include(obj.ownMaterialNumber); | ||
foundValues.push(obj.ownMaterialNumber); | ||
}); | ||
}); | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
local/bruno/puris-integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Get All Partners.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
meta { | ||
name: Get All Partners | ||
type: http | ||
seq: 7 | ||
} | ||
|
||
get { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/partners/all | ||
body: none | ||
auth: none | ||
} | ||
|
||
headers { | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
|
||
test("Verify response contains two objects (puris owner, supplier partner)", function () { | ||
expect(res.getBody()).to.be.an("array").with.lengthOf(2); | ||
}); | ||
|
||
test("Verify supplier partner values (BPNL with one BPNS with one BPNA)", function () { | ||
const responseJson = res.getBody(); | ||
|
||
const supplierPartner = responseJson.find(function (partner) { | ||
return partner.bpnl === bru.getEnvVar("SUPPLIER_BPNL"); | ||
}); | ||
|
||
expect(supplierPartner).to.have.property("bpnl"); | ||
|
||
expect(supplierPartner.bpnl).to.equal(bru.getEnvVar("SUPPLIER_BPNL")); | ||
|
||
expect(supplierPartner.sites).to.be.an("array").with.lengthOf(2); | ||
|
||
// check only the newly added site as the other one has been checked earlier | ||
const site = supplierPartner.sites.find(function (site) { | ||
return site.bpns === bru.getEnvVar("SUPPLIER_BPNS2"); | ||
}); | ||
|
||
expect(site.addresses).to.be.an("array").with.lengthOf(1); | ||
|
||
const address = site.addresses[0]; | ||
expect(address).to.have.property("bpna", bru.getEnvVar("SUPPLIER_BPNA2")); | ||
}); | ||
} |
39 changes: 39 additions & 0 deletions
39
...is-integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Get Material Partner Mappings.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
meta { | ||
name: Get Material Partner Mappings | ||
type: http | ||
seq: 9 | ||
} | ||
|
||
get { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{B64_MNR_CUSTOMER}} | ||
body: none | ||
auth: none | ||
} | ||
|
||
params:query { | ||
ownMaterialNumber: {{B64_MNR_CUSTOMER}} | ||
} | ||
|
||
headers { | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
|
||
test("Customer Mapping ok", function() { | ||
const customerBPNL = bru.getEnvVar("CUSTOMER_BPNL"); | ||
const customerMatNbr = bru.getEnvVar("MATERIAL_NUMBER_CUSTOMER"); | ||
expect(res.getBody()[customerBPNL]).to.equal(customerMatNbr); | ||
}) | ||
|
||
test("Supplier Mapping ok", function() { | ||
const supplierBPNL = bru.getEnvVar("SUPPLIER_BPNL"); | ||
const supplierMatNbr = bru.getEnvVar("MATERIAL_NUMBER_SUPPLIER"); | ||
expect(res.getBody()[supplierBPNL]).to.equal(supplierMatNbr); | ||
}) | ||
|
||
|
||
} |
36 changes: 36 additions & 0 deletions
36
local/bruno/puris-integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Get Own Sites.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
meta { | ||
name: Get Own Sites | ||
type: http | ||
seq: 10 | ||
} | ||
|
||
get { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/partners/ownSites | ||
body: none | ||
auth: none | ||
} | ||
|
||
headers { | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
tests { | ||
test("response is ok", function() { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
|
||
test("Verify own site values (one BPNS with one BPNA)", function () { | ||
const responseJson = res.getBody(); | ||
|
||
expect(responseJson).to.be.an("array").with.lengthOf(1); | ||
|
||
const site = responseJson.find(function (site) { | ||
return site.bpns === bru.getEnvVar("CUSTOMER_BPNS"); | ||
}); | ||
|
||
expect(site.addresses).to.be.an("array").with.lengthOf(1); | ||
|
||
const address = site.addresses[0]; | ||
expect(address).to.have.property("bpna", bru.getEnvVar("CUSTOMER_BPNA")); | ||
}); | ||
} |
42 changes: 42 additions & 0 deletions
42
...bruno/puris-integration-test/Test_01-MAD/01_01-Init/Customer/MAD/Get Supplier Partner.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
meta { | ||
name: Get Supplier Partner | ||
type: http | ||
seq: 5 | ||
} | ||
|
||
get { | ||
url: {{CUSTOMER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{SUPPLIER_BPNL}} | ||
body: none | ||
auth: none | ||
} | ||
|
||
params:query { | ||
partnerBpnl: {{SUPPLIER_BPNL}} | ||
} | ||
|
||
headers { | ||
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}} | ||
} | ||
|
||
tests { | ||
test("response is ok", function () { | ||
expect(res.getStatus()).to.equal(200); | ||
}) | ||
|
||
test("Verify partner values (BPNL with one BPNS with one BPNA)", function () { | ||
const responseJson = res.getBody(); | ||
|
||
expect(responseJson).to.have.property("bpnl"); | ||
expect(responseJson.bpnl).to.equal(bru.getEnvVar("SUPPLIER_BPNL")); | ||
|
||
expect(responseJson.sites).to.be.an("array").with.lengthOf(1); | ||
|
||
const site = responseJson.sites[0]; | ||
expect(site).to.have.property("bpns", bru.getEnvVar("SUPPLIER_BPNS")); | ||
|
||
expect(site.addresses).to.be.an("array").with.lengthOf(1); | ||
|
||
const address = site.addresses[0]; | ||
expect(address).to.have.property("bpna", bru.getEnvVar("SUPPLIER_BPNA")); | ||
}); | ||
} |
Oops, something went wrong.