https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43674

Phan Quang Minh <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #207089|0                           |1
        is obsolete|                            |

--- Comment #12 from Phan Quang Minh <[email protected]> ---
Comment on attachment 207089
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207089
Bug 43674: Wrap request.t test data in the ISO18626Message envelope

>From ff318d95362027ea79da9349316f8db055717f05 Mon Sep 17 00:00:00 2001
>From: Pedro Amorim <[email protected]>
>Date: Wed, 30 Sep 2026 15:51:50 +0000
>Subject: [PATCH] Bug 43674: Wrap request.t test data in the ISO18626Message
> envelope
>
>The request, requestingAgencyMessage and mocked partner confirmation
>test data now use the ISO18626Message envelope, in the ISO 18626
>namespace, instead of bare messages in a placeholder namespace.
>
>Test plan:
>1) prove t/db_dependent/api/v1/iso18626/request.t
>
>Co-Authored-By: Claude Opus 5.5 <[email protected]>
>---
> t/db_dependent/api/v1/iso18626/request.t | 248 ++++++++++++-----------
> 1 file changed, 132 insertions(+), 116 deletions(-)
>
>diff --git a/t/db_dependent/api/v1/iso18626/request.t 
>b/t/db_dependent/api/v1/iso18626/request.t
>index b1b21efec21..94fa7b1cbb0 100755
>--- a/t/db_dependent/api/v1/iso18626/request.t
>+++ b/t/db_dependent/api/v1/iso18626/request.t
>@@ -61,19 +61,21 @@ subtest 'list() tests' => sub {
>     my $userid = $librarian->userid;
> 
>     my $requestXml = <<'XML';
>-        <request xmlns="https://example.com/ill/request";>
>-        <header>
>-          <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>-          <timestamp>2023-03-15 14:30:00</timestamp>
>-          <requestingAgencyId>
>-            <agencyIdType>ISIL</agencyIdType>
>-            <agencyIdValue>req_agency_value</agencyIdValue>
>-          </requestingAgencyId>
>-        </header>
>-        <bibliographicInfo>
>-          <title>This is an optional title</title>
>-        </bibliographicInfo>
>-      </request>
>+        <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+          <request>
>+            <header>
>+              <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>+              <timestamp>2023-03-15 14:30:00</timestamp>
>+              <requestingAgencyId>
>+                <agencyIdType>ISIL</agencyIdType>
>+                <agencyIdValue>req_agency_value</agencyIdValue>
>+              </requestingAgencyId>
>+            </header>
>+            <bibliographicInfo>
>+              <title>This is an optional title</title>
>+            </bibliographicInfo>
>+          </request>
>+        </ISO18626Message>
> XML
> 
>     #FIXME: This error message should be something like "Expected 
> content-type application/xml"
>@@ -97,22 +99,24 @@ XML
>     );
> 
>     my $bad_auth_requestXml = <<'XML';
>-        <request xmlns="https://example.com/ill/request";>
>-        <header>
>-          <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>-          <timestamp>2023-03-15 14:30:00</timestamp>
>-          <requestingAgencyId>
>-            <agencyIdType>ISIL</agencyIdType>
>-            <agencyIdValue>req_agency_value</agencyIdValue>
>-          </requestingAgencyId>
>-        </header>
>-        <bibliographicInfo>
>-          <title>This is an optional title</title>
>-        </bibliographicInfo>
>-        <serviceInfo>
>-          <serviceType>Copy</serviceType>
>-        </serviceInfo>
>-      </request>
>+        <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+          <request>
>+            <header>
>+              <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>+              <timestamp>2023-03-15 14:30:00</timestamp>
>+              <requestingAgencyId>
>+                <agencyIdType>ISIL</agencyIdType>
>+                <agencyIdValue>req_agency_value</agencyIdValue>
>+              </requestingAgencyId>
>+            </header>
>+            <bibliographicInfo>
>+              <title>This is an optional title</title>
>+            </bibliographicInfo>
>+            <serviceInfo>
>+              <serviceType>Copy</serviceType>
>+            </serviceInfo>
>+          </request>
>+        </ISO18626Message>
> XML
> 
>     $t->post_ok(
>@@ -127,11 +131,13 @@ XML
>         'error value is authentication failed'
>     );
>     my $supplyingAgencyMessageConfirmationXml = <<'XML';
>-        <supplyingAgencyMessageConfirmation 
>xmlns="https://example.com/ill/request";>
>-          <confirmationHeader>
>-            <timestamp>2023-01-01T00:00:00Z</timestamp>
>-          </confirmationHeader>
>-        </supplyingAgencyMessageConfirmation>
>+        <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+          <supplyingAgencyMessageConfirmation>
>+            <confirmationHeader>
>+              <timestamp>2023-01-01T00:00:00Z</timestamp>
>+            </confirmationHeader>
>+          </supplyingAgencyMessageConfirmation>
>+        </ISO18626Message>
> XML
> 
>     my $mock_ua_response = Test::MockObject->new();
>@@ -151,26 +157,28 @@ XML
>     );
> 
>     my $authenticated_requestXml = <<'XML';
>-        <request xmlns="https://example.com/ill/request";>
>-        <header>
>-          <requestingAgencyAuthentication>
>-            <accountId>asd</accountId>
>-            <securityCode>asds</securityCode>
>-          </requestingAgencyAuthentication>
>-          <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>-          <timestamp>2023-03-15 14:30:00</timestamp>
>-          <requestingAgencyId>
>-            <agencyIdType>ISIL</agencyIdType>
>-            <agencyIdValue>req_agency_value</agencyIdValue>
>-          </requestingAgencyId>
>-        </header>
>-        <bibliographicInfo>
>-          <title>This is an optional title</title>
>-        </bibliographicInfo>
>-        <serviceInfo>
>-          <serviceType>Copy</serviceType>
>-        </serviceInfo>
>-      </request>
>+        <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+          <request>
>+            <header>
>+              <requestingAgencyAuthentication>
>+                <accountId>asd</accountId>
>+                <securityCode>asds</securityCode>
>+              </requestingAgencyAuthentication>
>+              <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>+              <timestamp>2023-03-15 14:30:00</timestamp>
>+              <requestingAgencyId>
>+                <agencyIdType>ISIL</agencyIdType>
>+                <agencyIdValue>req_agency_value</agencyIdValue>
>+              </requestingAgencyId>
>+            </header>
>+            <bibliographicInfo>
>+              <title>This is an optional title</title>
>+            </bibliographicInfo>
>+            <serviceInfo>
>+              <serviceType>Copy</serviceType>
>+            </serviceInfo>
>+          </request>
>+        </ISO18626Message>
> XML
> 
>     $t->post_ok(
>@@ -194,7 +202,8 @@ XML
>             . $last_request->iso18626_request_id => json => { status => 
> 'Loaned' } )->status_is(200);
> 
>     my $requestingAgencyMessagexml = '
>-    <requestingAgencyMessage xmlns="https://example.com/ill/request";>
>+    <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+      <requestingAgencyMessage>
>         <header>
>           <requestingAgencyAuthentication>
>             <accountId>asd</accountId>
>@@ -213,7 +222,8 @@ XML
>           </supplyingAgencyId>
>         </header>
>         <action>%s</action>
>-      </requestingAgencyMessage>';
>+      </requestingAgencyMessage>
>+    </ISO18626Message>';
> 
>     my $invalid_action_requestingAgencyMessagexml =
>         sprintf( $requestingAgencyMessagexml, 
> $last_request->iso18626_request_id, 'InvalidAction' );
>@@ -326,26 +336,28 @@ subtest 'send_message() tests' => sub {
>     );
> 
>     my $request_no_callback_xml = <<'XML';
>-        <request xmlns="https://example.com/ill/request";>
>-        <header>
>-          <requestingAgencyAuthentication>
>-            <accountId>no_callback_test</accountId>
>-            <securityCode>test_secret_1</securityCode>
>-          </requestingAgencyAuthentication>
>-          <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>-          <timestamp>2023-03-15 14:30:00</timestamp>
>-          <requestingAgencyId>
>-            <agencyIdType>ISIL</agencyIdType>
>-            <agencyIdValue>req_agency_value</agencyIdValue>
>-          </requestingAgencyId>
>-        </header>
>-        <bibliographicInfo>
>-          <title>Test request - no callback</title>
>-        </bibliographicInfo>
>-        <serviceInfo>
>-          <serviceType>Copy</serviceType>
>-        </serviceInfo>
>-      </request>
>+        <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+          <request>
>+            <header>
>+              <requestingAgencyAuthentication>
>+                <accountId>no_callback_test</accountId>
>+                <securityCode>test_secret_1</securityCode>
>+              </requestingAgencyAuthentication>
>+              <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>+              <timestamp>2023-03-15 14:30:00</timestamp>
>+              <requestingAgencyId>
>+                <agencyIdType>ISIL</agencyIdType>
>+                <agencyIdValue>req_agency_value</agencyIdValue>
>+              </requestingAgencyId>
>+            </header>
>+            <bibliographicInfo>
>+              <title>Test request - no callback</title>
>+            </bibliographicInfo>
>+            <serviceInfo>
>+              <serviceType>Copy</serviceType>
>+            </serviceInfo>
>+          </request>
>+        </ISO18626Message>
> XML
> 
>     $t->post_ok(
>@@ -389,26 +401,28 @@ XML
>     $mock_ua_fail->mock( 'post', sub { return $mock_fail_response; } );
> 
>     my $request_bad_endpoint_xml = <<'XML';
>-        <request xmlns="https://example.com/ill/request";>
>-        <header>
>-          <requestingAgencyAuthentication>
>-            <accountId>bad_endpoint_test</accountId>
>-            <securityCode>test_secret_2</securityCode>
>-          </requestingAgencyAuthentication>
>-          <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>-          <timestamp>2023-03-15 14:30:00</timestamp>
>-          <requestingAgencyId>
>-            <agencyIdType>ISIL</agencyIdType>
>-            <agencyIdValue>req_agency_value</agencyIdValue>
>-          </requestingAgencyId>
>-        </header>
>-        <bibliographicInfo>
>-          <title>Test request - bad endpoint</title>
>-        </bibliographicInfo>
>-        <serviceInfo>
>-          <serviceType>Copy</serviceType>
>-        </serviceInfo>
>-      </request>
>+        <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+          <request>
>+            <header>
>+              <requestingAgencyAuthentication>
>+                <accountId>bad_endpoint_test</accountId>
>+                <securityCode>test_secret_2</securityCode>
>+              </requestingAgencyAuthentication>
>+              <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>+              <timestamp>2023-03-15 14:30:00</timestamp>
>+              <requestingAgencyId>
>+                <agencyIdType>ISIL</agencyIdType>
>+                <agencyIdValue>req_agency_value</agencyIdValue>
>+              </requestingAgencyId>
>+            </header>
>+            <bibliographicInfo>
>+              <title>Test request - bad endpoint</title>
>+            </bibliographicInfo>
>+            <serviceInfo>
>+              <serviceType>Copy</serviceType>
>+            </serviceInfo>
>+          </request>
>+        </ISO18626Message>
> XML
> 
>     $t->post_ok(
>@@ -444,26 +458,28 @@ XML
>     );
> 
>     my $request_invalid_url_xml = <<'XML';
>-        <request xmlns="https://example.com/ill/request";>
>-        <header>
>-          <requestingAgencyAuthentication>
>-            <accountId>invalid_url_test</accountId>
>-            <securityCode>test_secret_3</securityCode>
>-          </requestingAgencyAuthentication>
>-          <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>-          <timestamp>2023-03-15 14:30:00</timestamp>
>-          <requestingAgencyId>
>-            <agencyIdType>ISIL</agencyIdType>
>-            <agencyIdValue>req_agency_value</agencyIdValue>
>-          </requestingAgencyId>
>-        </header>
>-        <bibliographicInfo>
>-          <title>Test request - invalid url</title>
>-        </bibliographicInfo>
>-        <serviceInfo>
>-          <serviceType>Copy</serviceType>
>-        </serviceInfo>
>-      </request>
>+        <ISO18626Message xmlns="http://illtransactions.org/2013/iso18626"; 
>xmlns:ill="http://illtransactions.org/2013/iso18626"; ill:version="1.2">
>+          <request>
>+            <header>
>+              <requestingAgencyAuthentication>
>+                <accountId>invalid_url_test</accountId>
>+                <securityCode>test_secret_3</securityCode>
>+              </requestingAgencyAuthentication>
>+              <requestingAgencyRequestId>XYZ</requestingAgencyRequestId>
>+              <timestamp>2023-03-15 14:30:00</timestamp>
>+              <requestingAgencyId>
>+                <agencyIdType>ISIL</agencyIdType>
>+                <agencyIdValue>req_agency_value</agencyIdValue>
>+              </requestingAgencyId>
>+            </header>
>+            <bibliographicInfo>
>+              <title>Test request - invalid url</title>
>+            </bibliographicInfo>
>+            <serviceInfo>
>+              <serviceType>Copy</serviceType>
>+            </serviceInfo>
>+          </request>
>+        </ISO18626Message>
> XML
> 
>     $t->post_ok(
>-- 
>2.47.3
>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to