[refactor] Migrate integration tests to Apache HttpClient 5.x (hybrid HC4/HC5)#6393
Draft
duncdrum wants to merge 5 commits into
Draft
[refactor] Migrate integration tests to Apache HttpClient 5.x (hybrid HC4/HC5)#6393duncdrum wants to merge 5 commits into
duncdrum wants to merge 5 commits into
Conversation
dizzzz
reviewed
May 22, 2026
Member
|
PR -though draft- seems to be a mixup of multiple PRs. That said, I tend to ditch the apache http client where possible and simplify the codebase by using the the native HttpClient , available since Java9. What about you @reinhapa ? |
Contributor
Author
|
@dizzzz yes the jetty upgrade fixes come first and are separate. We could merge it, but my plan is to keep rebasing, and cleanup the workarounds along the way. |
96bcc24 to
c8d0d50
Compare
duncdrum
added a commit
to duncdrum/exist
that referenced
this pull request
May 25, 2026
Add PortalRedirectTest for GET / in distribution layout. Deploy the portal with org.exist.jetty.WebAppContext so Windows PathResource wrapping applies, and skip BrokerPool.stopAll when that static-only context stops. Document CHAIN_PRIORITY spacing, WindowsPathResource instanceof audit, and LEGACY_TOKEN_SEPARATOR removal tied to HC4 Phase 5 in PR eXist-db#6393.
duncdrum
added a commit
to duncdrum/exist
that referenced
this pull request
May 26, 2026
Add PortalRedirectTest for GET / in distribution layout. Deploy the portal with org.exist.jetty.WebAppContext so Windows PathResource wrapping applies, and skip BrokerPool.stopAll when that static-only context stops. Document CHAIN_PRIORITY spacing, WindowsPathResource instanceof audit, and LEGACY_TOKEN_SEPARATOR removal tied to HC4 Phase 5 in PR eXist-db#6393.
Member
|
Please rebase @duncdrum |
Member
Member
|
@duncdrum the code does no longer compile |
Add HC5 BOM (httpclient5/httpclient5-fluent 5.6.1, httpcore5 5.4) alongside HC4 for hybrid coexistence. Migrate exist-core and extension HTTP tests to org.apache.hc.*; keep extensions/webdav on HC4 for milton-client JUnit tests. HC5 fluent Executor auth does not reliably attach Basic credentials to /exist/... URLs, so AbstractHttpTest adds a preemptive Authorization interceptor (same pattern in restxq and file module tests). Co-authored-by: Cursor <cursoragent@cursor.com>
Publish exist-core test-jar so extension ITs share AbstractHttpTest. Simplify auth to a preemptive Authorization interceptor only; add AuthenticatedHttpClientTest regression guard. Close HTTP responses in restxq helpers; dedupe auth in restxq/file. LoginModuleIT: disable retries and close responses. Document expath HC4/HC5 hybrid. Close MoveResourceTest connection pool after class.
Removes HC4/milton-client test harness from exist-webdav (Gate A). Litmus bats cover RFC compliance; WebDavRoundTripTest keeps eXist-specific XML serialization checks (DOCTYPE, xml-decl, CDATA).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates eXist-owned HTTP client usage from Apache HttpClient 4.x to HttpClient 5.6.1, using a deliberate hybrid model: HC5 for integration tests and extension code we control; HC4 retained only where third-party APIs require it.
HC5 defaults to RFC 6265 cookies, which aligns with Jetty 12 Set-Cookie behaviour and removes HC4 CookieSpecs.STANDARD workarounds in migrated tests (jetty/jetty.project#12771).
HC5 Phases 1–4 are complete. WebDAV Gate A is cleared (milton-client removed). Phase 5 (remove HC4 from the parent BOM) is deferred pending expath Gate B only.
Closes #5771
Note: Jetty 12.1 test and runtime fixes are tracked separately in PR #6392 and are out of scope for this description.
What changed
BOM (exist-parent/pom.xml)
Migrated to HC5 (org.apache.hc.*)
Test infrastructure cleanup
WebDAV (Gate A cleared)
Standalone Jetty webapp template
Still on HC4 (Phase 5 Gate B)
Auth behaviour (HC5 quirk)
HC5 fluent Executor.authPreemptive() does not reliably attach Basic credentials to /exist/... URLs. AbstractHttpTest.createAuthenticatedClient() sets preemptive Authorization via a request interceptor, shared through the exist-core test-jar (restxq and file modules).
Documentation
What this PR does not do
Phase 5 follow-up
Gate A (webdav): done in this PR.
Gate B (expath):
Test plan
References