From 92c3d8f0eb195bda800c4f423d1ea27e0637f6b6 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 12:35:20 +0100 Subject: [PATCH 01/11] Add more patron request checks for lastResult, ... --- .../PR Happy flow/Borrowing side get all actions.bru | 2 +- .../PR Happy flow/Borrowing side check status.bru | 7 +++++-- bruno/crosslink/PR Happy flow/Borrowing side check-in.bru | 2 +- .../crosslink/PR Happy flow/Borrowing side check-out.bru | 2 +- bruno/crosslink/PR Happy flow/Borrowing side receive.bru | 2 +- .../PR Happy flow/Borrowing side send-request.bru | 2 +- .../PR Happy flow/Borrowing side ship-return.bru | 2 +- .../crosslink/PR Happy flow/Create borrowing side PR.bru | 2 +- bruno/crosslink/PR Happy flow/Find lending PR id.bru | 3 ++- bruno/crosslink/PR Happy flow/Get Peers.bru | 2 +- .../crosslink/PR Happy flow/Lending side check status.bru | 7 +++++-- .../PR Happy flow/Lending side get all actions.bru | 2 +- .../PR Happy flow/Lending side mark-received.bru | 2 +- bruno/crosslink/PR Happy flow/Lending side ship.bru | 2 +- .../crosslink/PR Happy flow/Lending side will-supply.bru | 2 +- bruno/crosslink/PR Happy flow/Req Patron Events.bru | 2 +- bruno/crosslink/PR Happy flow/Requester Events.bru | 2 +- bruno/crosslink/PR Happy flow/Sup Patron Events.bru | 8 ++++---- bruno/crosslink/PR Happy flow/Supplier Events.bru | 2 +- 19 files changed, 31 insertions(+), 24 deletions(-) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru b/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru index 6505d221..f3cb7388 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side get all actions type: http - seq: 13 + seq: 20 } get { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check status.bru b/bruno/crosslink/PR Happy flow/Borrowing side check status.bru index d703747e..eaf1d7bd 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check status.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check status.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check status type: http - seq: 12 + seq: 19 } get { @@ -25,7 +25,10 @@ auth:basic { script:post-response { test("Check if patron request is complete", () => { - expect(res.getBody().state).to.eql("COMPLETED"); + const pr = res.getBody() + expect(pr.lastActionResult).to.eql("SUCCESS"); + expect(pr.lastAction).to.eql("ship-return"); + expect(pr.state).to.eql("COMPLETED"); }); } diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru index 97e42bce..166453e1 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check-in type: http - seq: 8 + seq: 13 } post { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru index b4de953f..e07ae16e 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check-out type: http - seq: 7 + seq: 11 } post { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side receive.bru b/bruno/crosslink/PR Happy flow/Borrowing side receive.bru index a66c973a..4653cc3c 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side receive.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side receive.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side receive type: http - seq: 6 + seq: 9 } post { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side send-request.bru b/bruno/crosslink/PR Happy flow/Borrowing side send-request.bru index 314581d7..56ab86bf 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side send-request.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side send-request.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side send-request type: http - seq: 2 + seq: 3 } post { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru b/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru index 2ce6b987..21600653 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side ship-return type: http - seq: 9 + seq: 15 } post { diff --git a/bruno/crosslink/PR Happy flow/Create borrowing side PR.bru b/bruno/crosslink/PR Happy flow/Create borrowing side PR.bru index dd5b4938..939b05cf 100644 --- a/bruno/crosslink/PR Happy flow/Create borrowing side PR.bru +++ b/bruno/crosslink/PR Happy flow/Create borrowing side PR.bru @@ -1,7 +1,7 @@ meta { name: Create borrowing side PR type: http - seq: 1 + seq: 2 } post { diff --git a/bruno/crosslink/PR Happy flow/Find lending PR id.bru b/bruno/crosslink/PR Happy flow/Find lending PR id.bru index 6572f122..d9cafd9f 100644 --- a/bruno/crosslink/PR Happy flow/Find lending PR id.bru +++ b/bruno/crosslink/PR Happy flow/Find lending PR id.bru @@ -1,7 +1,7 @@ meta { name: Find lending PR id type: http - seq: 3 + seq: 5 } get { @@ -34,6 +34,7 @@ script:post-response { test("Check if found lending PR", () => { expect(lendingPr).to.exist; expect(lendingPr.id).to.be.a("string").and.not.empty; + expect(lendingPr.lastActionResult).is.equal("SUCCESS") bru.setVar("lendingPrId", lendingPr.id); }); } diff --git a/bruno/crosslink/PR Happy flow/Get Peers.bru b/bruno/crosslink/PR Happy flow/Get Peers.bru index 3fb67130..5ac9e236 100644 --- a/bruno/crosslink/PR Happy flow/Get Peers.bru +++ b/bruno/crosslink/PR Happy flow/Get Peers.bru @@ -1,7 +1,7 @@ meta { name: Get Peers type: http - seq: 19 + seq: 26 } get { diff --git a/bruno/crosslink/PR Happy flow/Lending side check status.bru b/bruno/crosslink/PR Happy flow/Lending side check status.bru index 08e38e06..980b03d1 100644 --- a/bruno/crosslink/PR Happy flow/Lending side check status.bru +++ b/bruno/crosslink/PR Happy flow/Lending side check status.bru @@ -1,7 +1,7 @@ meta { name: Lending side check status type: http - seq: 11 + seq: 18 } get { @@ -25,7 +25,10 @@ auth:basic { script:post-response { test("Check if patron request is complete", () => { - expect(res.getBody().state).to.eql("COMPLETED"); + const pr = res.getBody() + expect(pr.lastActionResult).to.eql("SUCCESS"); + expect(pr.lastAction).to.eql("mark-received"); + expect(pr.state).to.eql("COMPLETED"); }); } diff --git a/bruno/crosslink/PR Happy flow/Lending side get all actions.bru b/bruno/crosslink/PR Happy flow/Lending side get all actions.bru index d559444d..62fd0bb2 100644 --- a/bruno/crosslink/PR Happy flow/Lending side get all actions.bru +++ b/bruno/crosslink/PR Happy flow/Lending side get all actions.bru @@ -1,7 +1,7 @@ meta { name: Lending side get all actions type: http - seq: 14 + seq: 21 } get { diff --git a/bruno/crosslink/PR Happy flow/Lending side mark-received.bru b/bruno/crosslink/PR Happy flow/Lending side mark-received.bru index 0c738b32..20cbaed4 100644 --- a/bruno/crosslink/PR Happy flow/Lending side mark-received.bru +++ b/bruno/crosslink/PR Happy flow/Lending side mark-received.bru @@ -1,7 +1,7 @@ meta { name: Lending side mark-received type: http - seq: 10 + seq: 17 } post { diff --git a/bruno/crosslink/PR Happy flow/Lending side ship.bru b/bruno/crosslink/PR Happy flow/Lending side ship.bru index 4149bbeb..d67411fc 100644 --- a/bruno/crosslink/PR Happy flow/Lending side ship.bru +++ b/bruno/crosslink/PR Happy flow/Lending side ship.bru @@ -1,7 +1,7 @@ meta { name: Lending side ship type: http - seq: 5 + seq: 7 } post { diff --git a/bruno/crosslink/PR Happy flow/Lending side will-supply.bru b/bruno/crosslink/PR Happy flow/Lending side will-supply.bru index 6cf89ed9..c8a88236 100644 --- a/bruno/crosslink/PR Happy flow/Lending side will-supply.bru +++ b/bruno/crosslink/PR Happy flow/Lending side will-supply.bru @@ -1,7 +1,7 @@ meta { name: Lending side will-supply type: http - seq: 4 + seq: 6 } post { diff --git a/bruno/crosslink/PR Happy flow/Req Patron Events.bru b/bruno/crosslink/PR Happy flow/Req Patron Events.bru index eb4cdb1f..b3b96819 100644 --- a/bruno/crosslink/PR Happy flow/Req Patron Events.bru +++ b/bruno/crosslink/PR Happy flow/Req Patron Events.bru @@ -1,7 +1,7 @@ meta { name: Req Patron Events type: http - seq: 16 + seq: 23 } get { diff --git a/bruno/crosslink/PR Happy flow/Requester Events.bru b/bruno/crosslink/PR Happy flow/Requester Events.bru index 70f4c5ce..66f5f2cf 100644 --- a/bruno/crosslink/PR Happy flow/Requester Events.bru +++ b/bruno/crosslink/PR Happy flow/Requester Events.bru @@ -1,7 +1,7 @@ meta { name: Requester Events type: http - seq: 15 + seq: 22 } get { diff --git a/bruno/crosslink/PR Happy flow/Sup Patron Events.bru b/bruno/crosslink/PR Happy flow/Sup Patron Events.bru index 38c3d367..1d7e2c29 100644 --- a/bruno/crosslink/PR Happy flow/Sup Patron Events.bru +++ b/bruno/crosslink/PR Happy flow/Sup Patron Events.bru @@ -1,7 +1,7 @@ meta { name: Sup Patron Events type: http - seq: 18 + seq: 25 } get { @@ -29,17 +29,17 @@ vars:pre-request { script:post-response { const responseData = res.getBody(); - + const eventsByAction = action => responseData.filter(pr => { return pr.eventData.CommonEventData.action == action; }); - + const expectActionWithFirstSuccess = action => { const events = eventsByAction(action); expect(events.length).to.be.at.least(1); expect(events[0].eventStatus).to.equal("SUCCESS"); }; - + ["validate", "will-supply", "ship", "mark-received"].forEach(action => { test(`Check ${action}`, () => { expectActionWithFirstSuccess(action); diff --git a/bruno/crosslink/PR Happy flow/Supplier Events.bru b/bruno/crosslink/PR Happy flow/Supplier Events.bru index 40f6932f..6f271c46 100644 --- a/bruno/crosslink/PR Happy flow/Supplier Events.bru +++ b/bruno/crosslink/PR Happy flow/Supplier Events.bru @@ -1,7 +1,7 @@ meta { name: Supplier Events type: http - seq: 17 + seq: 24 } get { From ca4d276eb8b6a6729018840bc0b1300d687b6eb8 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 12:44:26 +0100 Subject: [PATCH 02/11] Missing files --- .../Borrowing side check status.bru | 2 +- .../Borrowing side check-in check.bru | 37 ++++++++++++++++++ .../Borrowing side check-out check.bru | 37 ++++++++++++++++++ .../Borrowing side receive check.bru | 37 ++++++++++++++++++ .../Borrowing side send-request check.bru | 37 ++++++++++++++++++ .../Borrowing side ship-return check.bru | 38 +++++++++++++++++++ .../PR Happy flow/Find lending PR id.bru | 2 +- .../Lending side check status.bru | 2 +- .../PR Happy flow/Lending side ship check.bru | 37 ++++++++++++++++++ 9 files changed, 226 insertions(+), 3 deletions(-) create mode 100644 bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru create mode 100644 bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru create mode 100644 bruno/crosslink/PR Happy flow/Borrowing side receive check.bru create mode 100644 bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru create mode 100644 bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru create mode 100644 bruno/crosslink/PR Happy flow/Lending side ship check.bru diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check status.bru b/bruno/crosslink/PR Happy flow/Borrowing side check status.bru index eaf1d7bd..a53e6099 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check status.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check status.bru @@ -25,7 +25,7 @@ auth:basic { script:post-response { test("Check if patron request is complete", () => { - const pr = res.getBody() + const pr = res.getBody(); expect(pr.lastActionResult).to.eql("SUCCESS"); expect(pr.lastAction).to.eql("ship-return"); expect(pr.state).to.eql("COMPLETED"); diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru new file mode 100644 index 00000000..9f0454cb --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru @@ -0,0 +1,37 @@ +meta { + name: Borrowing side check-in check + type: http + seq: 14 +} + +get { + url: {{host}}/patron_requests/{{prId}}?side=borrowing + body: json + auth: basic +} + +params:query { + side: borrowing +} + +headers { + X-Okapi-Tenant: {{OkapiTenantReq}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for ship", function() { + const pr = res.getBody(); + expect(pr.lastAction).to.equal("check-in") + expect(pr.lastActionResult).to.equal("SUCCESS") + }); +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru new file mode 100644 index 00000000..1e86425c --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru @@ -0,0 +1,37 @@ +meta { + name: Borrowing side check-out check + type: http + seq: 12 +} + +get { + url: {{host}}/patron_requests/{{prId}}?side=borrowing + body: json + auth: basic +} + +params:query { + side: borrowing +} + +headers { + X-Okapi-Tenant: {{OkapiTenantReq}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for ship", function() { + const pr = res.getBody(); + expect(pr.lastAction).to.equal("check-out") + expect(pr.lastActionResult).to.equal("SUCCESS") + }); +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru b/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru new file mode 100644 index 00000000..f6d89dae --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru @@ -0,0 +1,37 @@ +meta { + name: Borrowing side receive check + type: http + seq: 10 +} + +get { + url: {{host}}/patron_requests/{{prId}}?side=borrowing + body: json + auth: basic +} + +params:query { + side: borrowing +} + +headers { + X-Okapi-Tenant: {{OkapiTenantReq}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for ship", function() { + const pr = res.getBody(); + expect(pr.lastAction).to.equal("receive") + expect(pr.lastActionResult).to.equal("SUCCESS") + }); +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru b/bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru new file mode 100644 index 00000000..93ce4284 --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru @@ -0,0 +1,37 @@ +meta { + name: Borrowing side send-request check + type: http + seq: 4 +} + +get { + url: {{host}}/patron_requests/{{prId}}?side=borrowing + body: json + auth: basic +} + +params:query { + side: borrowing +} + +headers { + X-Okapi-Tenant: {{OkapiTenantReq}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for ship", function() { + const pr = res.getBody(); + expect(pr.lastAction).to.equal("send-request") + expect(pr.lastActionResult).to.equal("SUCCESS") + }); +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru b/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru new file mode 100644 index 00000000..0006f332 --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru @@ -0,0 +1,38 @@ +meta { + name: Borrowing side ship-return check + type: http + seq: 16 +} + +get { + url: {{host}}/patron_requests/{{prId}}?side=borrowing + body: json + auth: basic +} + +params:query { + side: borrowing +} + +headers { + X-Okapi-Tenant: {{OkapiTenantReq}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for ship", function() { + const pr = res.getBody(); + expect(pr.lastAction).to.equal("ship-return") + expect(pr.lastActionResult).to.equal("SUCCESS") + expect(pr.state).to.eql("SHIPPED_RETURNED"); + }); +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/crosslink/PR Happy flow/Find lending PR id.bru b/bruno/crosslink/PR Happy flow/Find lending PR id.bru index d9cafd9f..5fab5acb 100644 --- a/bruno/crosslink/PR Happy flow/Find lending PR id.bru +++ b/bruno/crosslink/PR Happy flow/Find lending PR id.bru @@ -34,7 +34,7 @@ script:post-response { test("Check if found lending PR", () => { expect(lendingPr).to.exist; expect(lendingPr.id).to.be.a("string").and.not.empty; - expect(lendingPr.lastActionResult).is.equal("SUCCESS") + expect(lendingPr.lastActionResult).to.equal("SUCCESS") bru.setVar("lendingPrId", lendingPr.id); }); } diff --git a/bruno/crosslink/PR Happy flow/Lending side check status.bru b/bruno/crosslink/PR Happy flow/Lending side check status.bru index 980b03d1..7d9b388f 100644 --- a/bruno/crosslink/PR Happy flow/Lending side check status.bru +++ b/bruno/crosslink/PR Happy flow/Lending side check status.bru @@ -25,7 +25,7 @@ auth:basic { script:post-response { test("Check if patron request is complete", () => { - const pr = res.getBody() + const pr = res.getBody(); expect(pr.lastActionResult).to.eql("SUCCESS"); expect(pr.lastAction).to.eql("mark-received"); expect(pr.state).to.eql("COMPLETED"); diff --git a/bruno/crosslink/PR Happy flow/Lending side ship check.bru b/bruno/crosslink/PR Happy flow/Lending side ship check.bru new file mode 100644 index 00000000..2ca72569 --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Lending side ship check.bru @@ -0,0 +1,37 @@ +meta { + name: Lending side ship check + type: http + seq: 8 +} + +get { + url: {{host}}/patron_requests/{{lendingPrId}}?side=lending + body: json + auth: basic +} + +params:query { + side: lending +} + +headers { + X-Okapi-Tenant: {{OkapiTenantSup}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for ship", function() { + const pr = res.getBody(); + expect(pr.lastAction).to.equal("ship") + expect(pr.lastActionResult).to.equal("SUCCESS") + }); +} + +settings { + encodeUrl: true + timeout: 0 +} From bd5dc63499c8b133b71ceb1aad71991e790dce70 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 12:53:08 +0100 Subject: [PATCH 03/11] Fix test messages --- bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru | 2 +- .../crosslink/PR Happy flow/Borrowing side check-out check.bru | 2 +- bruno/crosslink/PR Happy flow/Borrowing side receive check.bru | 2 +- .../PR Happy flow/Borrowing side ship-return check.bru | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru index 9f0454cb..24cf7988 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru @@ -24,7 +24,7 @@ auth:basic { } script:post-response { - test("for ship", function() { + test("for check-in", function() { const pr = res.getBody(); expect(pr.lastAction).to.equal("check-in") expect(pr.lastActionResult).to.equal("SUCCESS") diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru index 1e86425c..84debfdb 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru @@ -24,7 +24,7 @@ auth:basic { } script:post-response { - test("for ship", function() { + test("for check-out", function() { const pr = res.getBody(); expect(pr.lastAction).to.equal("check-out") expect(pr.lastActionResult).to.equal("SUCCESS") diff --git a/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru b/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru index f6d89dae..043c2de1 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru @@ -24,7 +24,7 @@ auth:basic { } script:post-response { - test("for ship", function() { + test("for receive", function() { const pr = res.getBody(); expect(pr.lastAction).to.equal("receive") expect(pr.lastActionResult).to.equal("SUCCESS") diff --git a/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru b/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru index 0006f332..dbd35ab7 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru @@ -24,7 +24,7 @@ auth:basic { } script:post-response { - test("for ship", function() { + test("for ship-return", function() { const pr = res.getBody(); expect(pr.lastAction).to.equal("ship-return") expect(pr.lastActionResult).to.equal("SUCCESS") From 3a1a751b10da1fb2f630c9919cbf9ff1eca13c59 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 12:54:00 +0100 Subject: [PATCH 04/11] Another one --- .../PR Happy flow/Borrowing side send-request check.bru | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru b/bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru index 93ce4284..a2ff37dc 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side send-request check.bru @@ -24,7 +24,7 @@ auth:basic { } script:post-response { - test("for ship", function() { + test("for send-request", function() { const pr = res.getBody(); expect(pr.lastAction).to.equal("send-request") expect(pr.lastActionResult).to.equal("SUCCESS") From 9c48701f4195c766a61b2b03847b6913ba2df26c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 13:16:58 +0100 Subject: [PATCH 05/11] bruno: Check Items in two places --- .../Borrowing side get all actions.bru | 2 +- .../Borrowing side check items.bru | 41 +++++++++++++++++++ .../Borrowing side check status.bru | 2 +- .../Borrowing side check-in check.bru | 2 +- .../PR Happy flow/Borrowing side check-in.bru | 2 +- .../Borrowing side check-out check.bru | 2 +- .../Borrowing side check-out.bru | 2 +- .../Borrowing side receive check.bru | 2 +- .../PR Happy flow/Borrowing side receive.bru | 2 +- .../Borrowing side ship-return check.bru | 2 +- .../Borrowing side ship-return.bru | 2 +- bruno/crosslink/PR Happy flow/Get Peers.bru | 2 +- .../Lending side check items.bru | 41 +++++++++++++++++++ .../Lending side check status.bru | 2 +- .../Lending side get all actions.bru | 2 +- .../Lending side mark-received.bru | 2 +- .../PR Happy flow/Lending side ship check.bru | 2 +- .../PR Happy flow/Lending side ship.bru | 2 +- .../Lending side will-supply.bru | 2 +- .../PR Happy flow/Req Patron Events.bru | 2 +- .../PR Happy flow/Requester Events.bru | 2 +- .../PR Happy flow/Sup Patron Events.bru | 2 +- .../PR Happy flow/Supplier Events.bru | 2 +- 23 files changed, 103 insertions(+), 21 deletions(-) create mode 100644 bruno/crosslink/PR Happy flow/Borrowing side check items.bru create mode 100644 bruno/crosslink/PR Happy flow/Lending side check items.bru diff --git a/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru b/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru index f3cb7388..30e70023 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side get all actions.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side get all actions type: http - seq: 20 + seq: 22 } get { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru new file mode 100644 index 00000000..a874ea7f --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru @@ -0,0 +1,41 @@ +meta { + name: Borrowing side check items + type: http + seq: 12 +} + +get { + url: {{host}}/patron_requests/{{prId}}/items?side=borrowing + body: json + auth: basic +} + +params:query { + side: borrowing +} + +headers { + X-Okapi-Tenant: {{OkapiTenantReq}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for items", function() { + const pr = res.getBody(); + const expected = bru.getEnvVar("itemId"); + expect(pr.length).to.be.at.least(1); + pr.forEach(function(item) { + expect(item).to.have.property("itemId"); + expect(item.itemId).to.equal(expected); + }); + }); +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check status.bru b/bruno/crosslink/PR Happy flow/Borrowing side check status.bru index a53e6099..aebb58a2 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check status.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check status.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check status type: http - seq: 19 + seq: 21 } get { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru index 24cf7988..a91c8397 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-in check.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check-in check type: http - seq: 14 + seq: 16 } get { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru index 166453e1..5a2c8e2b 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-in.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check-in type: http - seq: 13 + seq: 15 } post { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru index 84debfdb..132552b4 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-out check.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check-out check type: http - seq: 12 + seq: 14 } get { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru b/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru index e07ae16e..10ec06be 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check-out.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side check-out type: http - seq: 11 + seq: 13 } post { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru b/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru index 043c2de1..be3e5159 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side receive check.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side receive check type: http - seq: 10 + seq: 11 } get { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side receive.bru b/bruno/crosslink/PR Happy flow/Borrowing side receive.bru index 4653cc3c..c0970c1d 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side receive.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side receive.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side receive type: http - seq: 9 + seq: 10 } post { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru b/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru index dbd35ab7..dc14d208 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side ship-return check.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side ship-return check type: http - seq: 16 + seq: 18 } get { diff --git a/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru b/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru index 21600653..51ebbbd9 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side ship-return.bru @@ -1,7 +1,7 @@ meta { name: Borrowing side ship-return type: http - seq: 15 + seq: 17 } post { diff --git a/bruno/crosslink/PR Happy flow/Get Peers.bru b/bruno/crosslink/PR Happy flow/Get Peers.bru index 5ac9e236..b614e1d4 100644 --- a/bruno/crosslink/PR Happy flow/Get Peers.bru +++ b/bruno/crosslink/PR Happy flow/Get Peers.bru @@ -1,7 +1,7 @@ meta { name: Get Peers type: http - seq: 26 + seq: 28 } get { diff --git a/bruno/crosslink/PR Happy flow/Lending side check items.bru b/bruno/crosslink/PR Happy flow/Lending side check items.bru new file mode 100644 index 00000000..b8f3a570 --- /dev/null +++ b/bruno/crosslink/PR Happy flow/Lending side check items.bru @@ -0,0 +1,41 @@ +meta { + name: Lending side check items + type: http + seq: 6 +} + +get { + url: {{host}}/patron_requests/{{lendingPrId}}/items?side=lending + body: json + auth: basic +} + +params:query { + side: lending +} + +headers { + X-Okapi-Tenant: {{OkapiTenantSup}} +} + +auth:basic { + username: {{userName}} + password: {{userPassword}} +} + +script:post-response { + test("for items", function() { + const pr = res.getBody(); + const expected = bru.getEnvVar("itemId"); + expect(pr.length).to.be.at.least(1); + pr.forEach(function(item) { + expect(item).to.have.property("itemId"); + expect(item.itemId).to.equal(expected); + }); + }); +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/crosslink/PR Happy flow/Lending side check status.bru b/bruno/crosslink/PR Happy flow/Lending side check status.bru index 7d9b388f..1afa2bef 100644 --- a/bruno/crosslink/PR Happy flow/Lending side check status.bru +++ b/bruno/crosslink/PR Happy flow/Lending side check status.bru @@ -1,7 +1,7 @@ meta { name: Lending side check status type: http - seq: 18 + seq: 20 } get { diff --git a/bruno/crosslink/PR Happy flow/Lending side get all actions.bru b/bruno/crosslink/PR Happy flow/Lending side get all actions.bru index 62fd0bb2..1df5c3be 100644 --- a/bruno/crosslink/PR Happy flow/Lending side get all actions.bru +++ b/bruno/crosslink/PR Happy flow/Lending side get all actions.bru @@ -1,7 +1,7 @@ meta { name: Lending side get all actions type: http - seq: 21 + seq: 23 } get { diff --git a/bruno/crosslink/PR Happy flow/Lending side mark-received.bru b/bruno/crosslink/PR Happy flow/Lending side mark-received.bru index 20cbaed4..fd639171 100644 --- a/bruno/crosslink/PR Happy flow/Lending side mark-received.bru +++ b/bruno/crosslink/PR Happy flow/Lending side mark-received.bru @@ -1,7 +1,7 @@ meta { name: Lending side mark-received type: http - seq: 17 + seq: 19 } post { diff --git a/bruno/crosslink/PR Happy flow/Lending side ship check.bru b/bruno/crosslink/PR Happy flow/Lending side ship check.bru index 2ca72569..5d2e0435 100644 --- a/bruno/crosslink/PR Happy flow/Lending side ship check.bru +++ b/bruno/crosslink/PR Happy flow/Lending side ship check.bru @@ -1,7 +1,7 @@ meta { name: Lending side ship check type: http - seq: 8 + seq: 9 } get { diff --git a/bruno/crosslink/PR Happy flow/Lending side ship.bru b/bruno/crosslink/PR Happy flow/Lending side ship.bru index d67411fc..92b62582 100644 --- a/bruno/crosslink/PR Happy flow/Lending side ship.bru +++ b/bruno/crosslink/PR Happy flow/Lending side ship.bru @@ -1,7 +1,7 @@ meta { name: Lending side ship type: http - seq: 7 + seq: 8 } post { diff --git a/bruno/crosslink/PR Happy flow/Lending side will-supply.bru b/bruno/crosslink/PR Happy flow/Lending side will-supply.bru index c8a88236..bacdc08b 100644 --- a/bruno/crosslink/PR Happy flow/Lending side will-supply.bru +++ b/bruno/crosslink/PR Happy flow/Lending side will-supply.bru @@ -1,7 +1,7 @@ meta { name: Lending side will-supply type: http - seq: 6 + seq: 7 } post { diff --git a/bruno/crosslink/PR Happy flow/Req Patron Events.bru b/bruno/crosslink/PR Happy flow/Req Patron Events.bru index b3b96819..fb9cec9c 100644 --- a/bruno/crosslink/PR Happy flow/Req Patron Events.bru +++ b/bruno/crosslink/PR Happy flow/Req Patron Events.bru @@ -1,7 +1,7 @@ meta { name: Req Patron Events type: http - seq: 23 + seq: 25 } get { diff --git a/bruno/crosslink/PR Happy flow/Requester Events.bru b/bruno/crosslink/PR Happy flow/Requester Events.bru index 66f5f2cf..295eca9e 100644 --- a/bruno/crosslink/PR Happy flow/Requester Events.bru +++ b/bruno/crosslink/PR Happy flow/Requester Events.bru @@ -1,7 +1,7 @@ meta { name: Requester Events type: http - seq: 22 + seq: 24 } get { diff --git a/bruno/crosslink/PR Happy flow/Sup Patron Events.bru b/bruno/crosslink/PR Happy flow/Sup Patron Events.bru index 1d7e2c29..cd5eac71 100644 --- a/bruno/crosslink/PR Happy flow/Sup Patron Events.bru +++ b/bruno/crosslink/PR Happy flow/Sup Patron Events.bru @@ -1,7 +1,7 @@ meta { name: Sup Patron Events type: http - seq: 25 + seq: 27 } get { diff --git a/bruno/crosslink/PR Happy flow/Supplier Events.bru b/bruno/crosslink/PR Happy flow/Supplier Events.bru index 6f271c46..6451ba1d 100644 --- a/bruno/crosslink/PR Happy flow/Supplier Events.bru +++ b/bruno/crosslink/PR Happy flow/Supplier Events.bru @@ -1,7 +1,7 @@ meta { name: Supplier Events type: http - seq: 24 + seq: 26 } get { From 0d63ee0f6497103f54adbc22e7bb76e759bb0821 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 13:32:09 +0100 Subject: [PATCH 06/11] check for barcode and itemId in borrowing side --- .../PR Happy flow/Borrowing side check items.bru | 9 ++++----- .../crosslink/PR Happy flow/Lending side check items.bru | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru index a874ea7f..488f3ed2 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru @@ -26,12 +26,11 @@ auth:basic { script:post-response { test("for items", function() { const pr = res.getBody(); - const expected = bru.getEnvVar("itemId"); expect(pr.length).to.be.at.least(1); - pr.forEach(function(item) { - expect(item).to.have.property("itemId"); - expect(item.itemId).to.equal(expected); - }); + pr.forEach(function(item) { + expect(item).to.have.property("itemId"); + expect(item).to.have.property("barcode"); + }); }); } diff --git a/bruno/crosslink/PR Happy flow/Lending side check items.bru b/bruno/crosslink/PR Happy flow/Lending side check items.bru index b8f3a570..8450f8a8 100644 --- a/bruno/crosslink/PR Happy flow/Lending side check items.bru +++ b/bruno/crosslink/PR Happy flow/Lending side check items.bru @@ -30,6 +30,7 @@ script:post-response { expect(pr.length).to.be.at.least(1); pr.forEach(function(item) { expect(item).to.have.property("itemId"); + expect(item).to.have.property("barcode"); expect(item.itemId).to.equal(expected); }); }); From e241d385fb856242d801cf430c537583a737730c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 13:51:41 +0100 Subject: [PATCH 07/11] No need to pass side for /patron_requests/{{PrId}}/items --- .../crosslink/PR Happy flow/Borrowing side check items.bru | 6 +----- bruno/crosslink/PR Happy flow/Lending side check items.bru | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru index 488f3ed2..bc70846d 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru @@ -5,15 +5,11 @@ meta { } get { - url: {{host}}/patron_requests/{{prId}}/items?side=borrowing + url: {{host}}/patron_requests/{{prId}}/items body: json auth: basic } -params:query { - side: borrowing -} - headers { X-Okapi-Tenant: {{OkapiTenantReq}} } diff --git a/bruno/crosslink/PR Happy flow/Lending side check items.bru b/bruno/crosslink/PR Happy flow/Lending side check items.bru index 8450f8a8..b72bc370 100644 --- a/bruno/crosslink/PR Happy flow/Lending side check items.bru +++ b/bruno/crosslink/PR Happy flow/Lending side check items.bru @@ -5,15 +5,11 @@ meta { } get { - url: {{host}}/patron_requests/{{lendingPrId}}/items?side=lending + url: {{host}}/patron_requests/{{lendingPrId}}/items body: json auth: basic } -params:query { - side: lending -} - headers { X-Okapi-Tenant: {{OkapiTenantSup}} } From 574ee2c250924e720d6ca66ae6ea72bcf78a9a50 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 13:55:34 +0100 Subject: [PATCH 08/11] Update bruno/crosslink/PR Happy flow/Borrowing side check items.bru Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../PR Happy flow/Borrowing side check items.bru | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru index bc70846d..69fdc073 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru @@ -21,12 +21,12 @@ auth:basic { script:post-response { test("for items", function() { - const pr = res.getBody(); - expect(pr.length).to.be.at.least(1); - pr.forEach(function(item) { - expect(item).to.have.property("itemId"); - expect(item).to.have.property("barcode"); - }); + const items = res.getBody(); + expect(items.length).to.be.at.least(1); + items.forEach(function(item) { + expect(item).to.have.property("itemId"); + expect(item).to.have.property("barcode"); + }); }); } From 67682145af9032f86b5f74755bd3fa3dfbce8811 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 13:55:43 +0100 Subject: [PATCH 09/11] Update bruno/crosslink/PR Happy flow/Borrowing side check items.bru Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- bruno/crosslink/PR Happy flow/Borrowing side check items.bru | 1 - 1 file changed, 1 deletion(-) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru index 69fdc073..82edfb4a 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru @@ -6,7 +6,6 @@ meta { get { url: {{host}}/patron_requests/{{prId}}/items - body: json auth: basic } From f75b3d6c1a1dbec381687d1e1d64bb006384d95f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 13:55:49 +0100 Subject: [PATCH 10/11] Update bruno/crosslink/PR Happy flow/Lending side check items.bru Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- bruno/crosslink/PR Happy flow/Lending side check items.bru | 1 - 1 file changed, 1 deletion(-) diff --git a/bruno/crosslink/PR Happy flow/Lending side check items.bru b/bruno/crosslink/PR Happy flow/Lending side check items.bru index b72bc370..26addeaf 100644 --- a/bruno/crosslink/PR Happy flow/Lending side check items.bru +++ b/bruno/crosslink/PR Happy flow/Lending side check items.bru @@ -6,7 +6,6 @@ meta { get { url: {{host}}/patron_requests/{{lendingPrId}}/items - body: json auth: basic } From 1a7d5eda5d2c91c15ec0dfcbe9b1e099d95582b1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Mar 2026 13:58:15 +0100 Subject: [PATCH 11/11] body: none --- bruno/crosslink/PR Happy flow/Borrowing side check items.bru | 1 + bruno/crosslink/PR Happy flow/Lending side check items.bru | 1 + 2 files changed, 2 insertions(+) diff --git a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru index 82edfb4a..22ea802c 100644 --- a/bruno/crosslink/PR Happy flow/Borrowing side check items.bru +++ b/bruno/crosslink/PR Happy flow/Borrowing side check items.bru @@ -6,6 +6,7 @@ meta { get { url: {{host}}/patron_requests/{{prId}}/items + body: none auth: basic } diff --git a/bruno/crosslink/PR Happy flow/Lending side check items.bru b/bruno/crosslink/PR Happy flow/Lending side check items.bru index 26addeaf..c9874384 100644 --- a/bruno/crosslink/PR Happy flow/Lending side check items.bru +++ b/bruno/crosslink/PR Happy flow/Lending side check items.bru @@ -6,6 +6,7 @@ meta { get { url: {{host}}/patron_requests/{{lendingPrId}}/items + body: none auth: basic }