Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-9954. Simplify assertions in hadoop-ozone unit tests #5818

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Assertions in the form:

assertTrue(<x> == <y>)
assertEquals(null, <x>) or assertTrue(<x> == null)
assertTrue(<x> != null)
assertEquals(<boolean>, <x>)

can be simplified to:

assertEquals(<x>, <y>)
assertNull(<x>)
assertNotNull(<x>)
assertTrue/assertFalse(<x>)

Not only are these simpler, some of them also provide more information in case of failure.

This PR updates such assertions in hadoop-ozone (except integration tests).

https://issues.apache.org/jira/browse/HDDS-9954

How was this patch tested?

CI:
https://github.com/adoroszlai/ozone/actions/runs/7250386337

@adoroszlai adoroszlai self-assigned this Dec 18, 2023
Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

Thanks @adoroszlai for the patch.

LGTM.

@adoroszlai adoroszlai merged commit 3bd5c61 into apache:master Dec 19, 2023
25 checks passed
@adoroszlai adoroszlai deleted the HDDS-9954 branch December 19, 2023 04:41
@adoroszlai
Copy link
Contributor Author

Thanks @aswinshakil, @hemantk-12 for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants