@@ -56,35 +56,18 @@ jobs:
5656 done
5757 sleep 5
5858
59- # Smoke tests: verify module loads and key functionality works
60- # Note: The XAR module cannot override the built-in http-client in
61- # the Docker image, so these tests verify the built-in module works .
62- # The key JSON-as-string fix is validated by the Maven integration tests .
63- - name : Test http:send-request basic GET
59+ # Smoke tests: verify module loads and works.
60+ # The bundled http-client module handles these on the Docker image;
61+ # the XAR module takes over once the bundled registration is removed .
62+ # Tests use eXist's own REST API (localhost) to avoid external deps .
63+ - name : Test http:send-request against eXist REST API
6464 run : |
6565 result=$(curl -sf -u admin: -H "Content-Type: application/xml" --data '
6666 <query xmlns="http://exist.sourceforge.net/NS/exist">
6767 <text><![CDATA[
6868 import module namespace http = "http://expath.org/ns/http-client";
6969 let $r := http:send-request(
70- <http:request method="GET" href="https://httpbin.org/get"/>
71- )
72- return string($r[1]/@status)
73- ]]></text>
74- </query>' "http://localhost:8080/exist/rest/db")
75- echo "$result"
76- echo "$result" | grep -q "200" || (echo "FAIL: expected status 200" && exit 1)
77-
78- - name : Test http:send-request POST with body
79- run : |
80- result=$(curl -sf -u admin: -H "Content-Type: application/xml" --data '
81- <query xmlns="http://exist.sourceforge.net/NS/exist">
82- <text><![CDATA[
83- import module namespace http = "http://expath.org/ns/http-client";
84- let $r := http:send-request(
85- <http:request method="POST" href="https://httpbin.org/post">
86- <http:body media-type="text/plain">hello</http:body>
87- </http:request>
70+ <http:request method="GET" href="http://localhost:8080/exist/rest/db"/>
8871 )
8972 return string($r[1]/@status)
9073 ]]></text>
9982 <text><![CDATA[
10083 import module namespace http = "http://expath.org/ns/http-client";
10184 let $r := http:send-request(
102- <http:request method="GET" href="https ://httpbin.org/get "/>
85+ <http:request method="GET" href="http ://localhost:8080/exist/rest/db "/>
10386 )
10487 return count($r[1]/http:header) > 0
10588 ]]></text>
11497 <text><![CDATA[
11598 import module namespace http = "http://expath.org/ns/http-client";
11699 let $r := http:send-request(
117- <http:request method="GET" href="https ://httpbin.org/xml "/>
100+ <http:request method="GET" href="http ://localhost:8080/exist/rest/db "/>
118101 )
119- return count( $r[2]//slide) > 0
102+ return $r[2] instance of document-node()
120103 ]]></text>
121104 </query>' "http://localhost:8080/exist/rest/db")
122105 echo "$result"
0 commit comments