fix(ozone): add isTrue() to bare assertThat in testCaching - #11119
fix(ozone): add isTrue() to bare assertThat in testCaching#11119shoemoney wants to merge 1 commit into
Conversation
Fix verified RED->GREEN. No-op assertThat(boolean) in TestXceiverClientManager.testCaching at TestXceiverClientManager.java:93
There was a problem hiding this comment.
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.
|
@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. |
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:
.isTrue()to both assertions, matching HDDS-16249 patternFile: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientManager.java
How was this patch tested?
Fix verified RED to GREEN.
No functional behavior change outside test correctness.