HDDS-9993. Add static import for assertions and mocks in hdds-server-scm#5918
Merged
adoroszlai merged 8 commits intoapache:masterfrom Jan 5, 2024
Merged
HDDS-9993. Add static import for assertions and mocks in hdds-server-scm#5918adoroszlai merged 8 commits intoapache:masterfrom
adoroszlai merged 8 commits intoapache:masterfrom
Conversation
added 5 commits
January 4, 2024 16:52
adoroszlai
reviewed
Jan 4, 2024
Contributor
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks a lot @raju-balpande for working on this. Mostly looks good, few minor items noted.
...r-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestCloseContainerEventHandler.java
Outdated
Show resolved
Hide resolved
...r-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestCloseContainerEventHandler.java
Outdated
Show resolved
Hide resolved
Comment on lines
-68
to
-70
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertInstanceOf; | ||
| import static org.junit.jupiter.api.Assertions.fail; |
Contributor
There was a problem hiding this comment.
Please don't move these existing imports.
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMCertStore.java
Show resolved
Hide resolved
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java
Show resolved
Hide resolved
adoroszlai
approved these changes
Jan 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add static import for assertions and mocks in hadoop-hdds/server-scm.
he goal of this task is to add import static for all assertions and interactions with mocks. Replacing:
Assertions.assert(...) -> assert(...)
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.<...>()
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9993
How was this patch tested?
Tested the test cases in CI-CD pipeline.