Skip to content

test: strengthen IP address utility assertions#10649

Open
Loyal-Young wants to merge 1 commit into
apache:developfrom
Loyal-Young:codex/strengthen-ip-address-tests
Open

test: strengthen IP address utility assertions#10649
Loyal-Young wants to merge 1 commit into
apache:developfrom
Loyal-Young:codex/strengthen-ip-address-tests

Conversation

@Loyal-Young

Copy link
Copy Markdown

Summary

  • replace JVM assert statements in IPAddressUtilsTest with AssertJ assertions
  • preserve all IPv4, IPv6, CIDR, scope, and bracketed-address expectations

Why

Framework assertions make each test expectation explicit and provide useful failure diagnostics without depending on JVM assertion settings.

Impact

Production code is unchanged. The existing IP address utility coverage becomes more robust and easier to diagnose when it fails.

Validation

  • git diff --check
  • mvn --batch-mode --no-transfer-progress -pl common -Djacoco.skip=true -Dtest=IPAddressUtilsTest test

@Loyal-Young
Loyal-Young marked this pull request as ready for review July 22, 2026 17:15

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review by github-manager-bot

Summary

Replaces JVM assert statements with AssertJ assertions in IPAddressUtilsTest, making test expectations explicit and independent of JVM assertion settings. Clean, well-scoped test improvement.

Findings

  • [Info] The diff rewrites the entire file (+84/-83 on a 92-line file), which suggests a line-ending normalization (CRLF → LF) alongside the semantic changes. Consider mentioning this in the PR description or separating it into a dedicated commit to keep git blame history cleaner.
  • [Info] Also fixes the missing newline at end of file — good cleanup.

Assessment

  • All existing test expectations (IPv4, IPv6, CIDR, scope, bracketed-address) are correctly preserved
  • assertThat(X).isTrue() / assertThat(X).isFalse() conversions are semantically identical to the original assert X / assert !X
  • AssertJ import is correctly added
  • No production code changes

LGTM. Straightforward test hardening with no risk.


Automated review by github-manager-bot

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