[
https://issues.apache.org/jira/browse/HADOOP-19425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17926615#comment-17926615
]
ASF GitHub Bot commented on HADOOP-19425:
-----------------------------------------
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`.
> [ABFS] Upgrade JUnit from 4 to 5 in hadoop-azure.
> -------------------------------------------------
>
> Key: HADOOP-19425
> URL: https://issues.apache.org/jira/browse/HADOOP-19425
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: build, fs/azure, test
> Affects Versions: 3.5.0
> Reporter: Shilun Fan
> Assignee: Shilun Fan
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]