Added custom header tests - #3060
Conversation
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
TriageCategory: Summary What this impacts
Concerns
Required reviewer action
|
|
@cursor review |
There was a problem hiding this comment.
Pull request overview
This PR adds test coverage and documentation for passing custom HTTP headers (especially X-ClickHouse-Replica-Tag for ClickHouse Cloud sticky sessions) and standardizes WireMock usage across modules by centralizing its version in the parent POM.
Changes:
- Add WireMock-based unit tests validating that V1
custom_http_headersare applied to HTTP requests (JDBC v1 path and Apache HTTP client path). - Document how to configure custom HTTP headers for the Java client and JDBC (including ClickHouse Cloud sticky-session guidance).
- Introduce
HEADER_REPLICA_TAGconstants and centralize the WireMock version via${wiremock.version}.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Adds ${wiremock.version} property for reuse across modules. |
| jdbc-v2/pom.xml | Switches WireMock dependency to use ${wiremock.version}. |
| client-v2/pom.xml | Switches WireMock dependency to use ${wiremock.version}. |
| clickhouse-http-client/pom.xml | Switches WireMock dependency to use ${wiremock.version}. |
| clickhouse-jdbc/pom.xml | Adds WireMock test dependency (using ${wiremock.version}) for new tests. |
| client-v2/src/main/java/com/clickhouse/client/api/http/ClickHouseHttpProto.java | Adds HEADER_REPLICA_TAG constant for reuse in docs/code. |
| clickhouse-http-client/src/main/java/com/clickhouse/client/http/config/ClickHouseHttpOption.java | Adds HEADER_REPLICA_TAG constant for V1 HTTP stack. |
| clickhouse-jdbc/src/test/java/com/clickhouse/jdbc/ClickHouseConnectionTest.java | Adds WireMock unit test validating V1 custom headers. |
| clickhouse-http-client/src/test/java/com/clickhouse/client/http/ApacheHttpConnectionImplTest.java | Adds WireMock unit test validating V1 custom headers for Apache HTTP provider. |
| docs/clickhouse-docs/jdbc.mdx | Documents JDBC v2 custom header configuration and ClickHouse Cloud sticky sessions; clarifies v1 vs v2 behavior. |
| docs/clickhouse-docs/client.mdx | Documents client-v2 custom header APIs and ClickHouse Cloud sticky sessions; updates option key mapping. |
Suppressed comments (1)
docs/clickhouse-docs/client.mdx:373
- This example also uses
clientBuilderwithout defining it, making the snippet incomplete.
clientBuilder.setOption(ClientConfigProperties.httpHeader("X-ClickHouse-Quota"), "test");
// equivalent to:
clientBuilder.setOption("http_header_X-CLICKHOUSE-QUOTA", "test");
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8ae294d. Configure here.
|
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7184951. Configure here.


Summary
X-ClickHouse-Replica-Tagheader constant toClickHouseHttpOptionandcom.clickhouse.client.api.http.ClickHouseHttpProtoChecklist
Delete items not relevant to your PR: