You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "wzhallright (via GitHub)" <gi...@apache.org> on 2023/12/25 11:42:52 UTC

[PR] HDDS-9996. Add static import for assertions and mocks in ozone-recon [ozone]

wzhallright opened a new pull request, #5866:
URL: https://github.com/apache/ozone/pull/5866

   ## What changes were proposed in this pull request?
   Add static import for assertions and mocks in hadoop-ozone/recon
   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-9996](https://issues.apache.org/jira/browse/HDDS-9996)
   
   ## CI
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9996. Add static import for assertions and mocks in ozone-recon [ozone]

Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on PR #5866:
URL: https://github.com/apache/ozone/pull/5866#issuecomment-1869085072

   ohhk,


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9996. Add static import for assertions and mocks in ozone-recon [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #5866:
URL: https://github.com/apache/ozone/pull/5866#issuecomment-1869561438

   Thanks @wzhallright for the patch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9996. Add static import for assertions and mocks in ozone-recon [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #5866:
URL: https://github.com/apache/ozone/pull/5866


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9996. Add static import for assertions and mocks in ozone-recon [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #5866:
URL: https://github.com/apache/ozone/pull/5866#issuecomment-1869081537

   > what is the benefit of doing this?
   
    * more readable code, less boilerplate
    * more consistent codebase; currently we have mixed use of both forms (with and without static import)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9996. Add static import for assertions and mocks in ozone-recon [ozone]

Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on PR #5866:
URL: https://github.com/apache/ozone/pull/5866#issuecomment-1869070460

   I am curious: what is the benefit of doing this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org