Skip to content

test: write with ipv6 host support#408

Open
NguyenHoangSon96 wants to merge 9 commits into
mainfrom
test/add-ipv6-test-cases
Open

test: write with ipv6 host support#408
NguyenHoangSon96 wants to merge 9 commits into
mainfrom
test/add-ipv6-test-cases

Conversation

@NguyenHoangSon96

Copy link
Copy Markdown
Contributor

Closes #

Proposed Changes

Briefly describe your proposed changes:

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@NguyenHoangSon96 NguyenHoangSon96 self-assigned this Jul 6, 2026
Copilot AI review requested due to automatic review settings July 6, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a regression test to ensure the client can write successfully when configured with an IPv6-host base URL, helping validate URL parsing/formatting behavior in the write path.

Changes:

  • Add a new writeWithIpv6Host JUnit test that starts a MockWebServer bound to an IPv6 address and performs a write.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +575 to +591
@Test
void writeWithIpv6Host() throws Exception {
try (MockWebServer mockWebServer = new MockWebServer()) {
mockWebServer.start(InetAddress.getByName("::"), 0);
mockWebServer.enqueue(createResponse(200));
String targetUrl = String.format("http://[%s]:%d/", mockWebServer.getHostName(), mockWebServer.getPort());

var influxdbClient = InfluxDBClient.getInstance(targetUrl, "my-token".toCharArray(), "my-database");
influxdbClient.writePoint(
Point.measurement("mem")
.setTag("tag", "one")
.setField("value", 1.0)
);
influxdbClient.close();
assertThat(mockWebServer.takeRequest().getBody().utf8()).isEqualTo("mem,tag=one value=1.0");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants