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.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to