slfan1989 commented on code in PR #7369:
URL: https://github.com/apache/hadoop/pull/7369#discussion_r1953566430
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/AbstractWasbTestBase.java:
##########
@@ -146,31 +147,37 @@ protected Path path(String filepath) throws IOException {
/**
* Return a path bonded to this method name, unique to this fork during
* parallel execution.
+ * @param testInfo Provides information about the currently executing test
method.
+ * This can include details such as the name of the test method, display
name.
* @return a method name unique to (fork, method).
* @throws IOException IO problems
*/
- protected Path methodPath() throws IOException {
- return path(methodName.getMethodName());
+ protected Path methodPath(TestInfo testInfo) throws IOException {
Review Comment:
Thank you for raising this issue! In JUnit 5, `org.junit.rules.TestName` has
been removed, and it is recommended to use `TestInfo` to get the test method
name. TestInfo can be used as a parameter, applied in `setup` or test methods,
but it cannot be declared as a class-level variable.
Your suggestion made me think of a new solution: we can implement a method
to retrieve the test method name and register it using the `@RegisterExtension`
annotation. This method will retrieve the current test method name during the
execution of `@BeforeEach`.
--
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]