Skip to content

fix(ozone): add isTrue() to bare assertThat in testCaching - #11119

Open
shoemoney wants to merge 1 commit into
apache:masterfrom
shoemoney:fix/ozone-assert-istrue
Open

fix(ozone): add isTrue() to bare assertThat in testCaching#11119
shoemoney wants to merge 1 commit into
apache:masterfrom
shoemoney:fix/ozone-assert-istrue

Conversation

@shoemoney

Copy link
Copy Markdown

What changes were proposed in this pull request?

Fix no-op AssertJ assertion in TestXceiverClientManager.testCaching.

The test used bare AssertJ assertThat(boolean) at lines 93 and 103 without a terminal assertion. This form creates an Assert object but never verifies it, so the check always passes even when the condition is false.

Change:

  • Add .isTrue() to both assertions, matching HDDS-16249 pattern

File: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientManager.java

How was this patch tested?

Fix verified RED to GREEN.

  • Stashed fix to confirm RED state contained bare assertions
  • Restored fix and verified diff is surgical, 1 file changed, 2 insertions, 2 deletions, no formatter blast radius

No functional behavior change outside test correctness.

Fix verified RED->GREEN. No-op assertThat(boolean) in TestXceiverClientManager.testCaching at TestXceiverClientManager.java:93
Copilot AI lite review requested due to automatic review settings August 26, 2026 00:01

Copilot 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.

Pull request overview

Fixes a no-op AssertJ usage in TestXceiverClientManager.testCaching where assertThat(boolean) was previously missing a terminal assertion, causing the checks to never actually fail. This improves correctness of the integration test without affecting production behavior.

Changes:

  • Convert two bare assertThat(clientX instanceof XceiverClientGrpc); statements into real assertions via .isTrue().
  • Ensure the caching test now properly validates the expected client implementation type.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ivandika3

ivandika3 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@shoemoney Thanks for the fix, however this is going to be fixed as part of #11056 . Maybe you can take a look at that PR instead?

Also if you haven't already please create a ASF Jira account https://github.com/apache/ozone/blob/master/CONTRIBUTING.md#jira-guideline so that you can raise a ticket and refer the ticket from this PR.

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.

3 participants