[
https://issues.apache.org/jira/browse/HADOOP-19415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17950812#comment-17950812
]
ASF GitHub Bot commented on HADOOP-19415:
-----------------------------------------
slfan1989 commented on code in PR #7419:
URL: https://github.com/apache/hadoop/pull/7419#discussion_r2083686364
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractAppendTest.java:
##########
@@ -41,6 +42,7 @@ public abstract class AbstractContractAppendTest extends
AbstractFSContractTestB
private Path testPath;
private Path target;
+ @BeforeEach
Review Comment:
@anujmodi2021 Thank you very much for reviewing the code! The reason for
this change is due to differences between `JUnit 4` and `JUnit 5` in handling
class inheritance. For example, with setup methods: in JUnit 4, if a method in
the parent class is annotated with `@Before`, it will still be executed even if
it’s overridden in the subclass. However, in `JUnit` 5, if the subclass does
not override the method, the` @BeforeEach` annotation in the parent class works
as expected. But if the subclass overrides the method, it must explicitly
include the `@BeforeEach` annotation; otherwise, the method will not be
executed during tests.
> Upgrade JUnit from 4 to 5 in hadoop-common.
> -------------------------------------------
>
> Key: HADOOP-19415
> URL: https://issues.apache.org/jira/browse/HADOOP-19415
> Project: Hadoop Common
> Issue Type: Sub-task
> 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]