will-sh opened a new pull request, #6041: URL: https://github.com/apache/ozone/pull/6041
## What changes were proposed in this pull request? HDDS-10151: Replace single-use Random objects with RandomUtils in test classes Please describe your PR in detail: Replace single-use Random objects by RandomUtils or similar. This is a code optimization task aimed at improving the efficiency of the codebase. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-10151 ## How was this patch tested? Each test class are manually tested using `mvn test -Dtest=ClassName` All the tests passed after the code change. For the Abstract classes, tests passed for the sub-classes that inherit from the superclasses after code change, for example: **TestOzoneContractLegacy** extends AbstractOzoneContractTest extends AbstractContractSeekTest **TestOFSWithOMRatis** extends AbstractRootedOzoneFileSystemTest ## Note **RandomUtils** cannot directly set a seed. In the below test classes (TestDeletedBlockLog.java, TestLeaderChoosePolicy.java, TestDeletedBlocksTxnShell.java) We don't see much benefit to set a seed, so **Random** is replaced by **RandomUtils** The test class TestMultipartObjectGet.java also doesn't really need to be secure so the **SecureRandom()** is replaced by **RandomUtils** -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
