Skip to content

HDDS-9992. Add static import for assertions and mocks in ozone-s3gateway#5863

Merged
adoroszlai merged 1 commit intoapache:masterfrom
wzhallright:HDDS-9992
Dec 25, 2023
Merged

HDDS-9992. Add static import for assertions and mocks in ozone-s3gateway#5863
adoroszlai merged 1 commit intoapache:masterfrom
wzhallright:HDDS-9992

Conversation

@wzhallright
Copy link
Contributor

@wzhallright wzhallright commented Dec 25, 2023

What changes were proposed in this pull request?

The goal of this task is to add import static for all assertions and interactions with mocks. Replacing:

Assertions.assert<X>(...) -> assert<X>(...)
Assertions.fail(...) -> fail(...)

and

Mockito.mock(...) -> mock(...)
Mockito.verify(...) -> verify(...)
Mockito.when(...) -> when(...)

and

ArgumentMatchers.any() -> any()
ArgumentMatchers.eq() -> eq()
ArgumentMatchers.matches() -> matches()
// also:
// Matchers.<...>()

makes the code more readable (shorter lines, less wrapping).

What is the link to the Apache JIRA

HDDS-9992

CI

https://github.com/wzhallright/ozone/actions/runs/7318668302

@adoroszlai adoroszlai merged commit 2816ed0 into apache:master Dec 25, 2023
@adoroszlai
Copy link
Contributor

Thanks @wzhallright for the patch.

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