szetszwo commented on code in PR #1269:
URL: https://github.com/apache/ratis/pull/1269#discussion_r2103695726
##########
pom.xml:
##########
@@ -433,12 +429,12 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>4.3.1</version>
+ <version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>annotations-api</artifactId>
- <version>6.0.53</version>
+ <version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
Review Comment:
tomcat dependency can be removed.
```diff
diff --git a/pom.xml b/pom.xml
index af14e426f2..6fca9e66d7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -435,12 +435,6 @@
<artifactId>mockito-core</artifactId>
<version>4.3.1</version>
</dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>annotations-api</artifactId>
- <version>6.0.53</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
</dependencyManagement>
diff --git a/ratis-proto/pom.xml b/ratis-proto/pom.xml
index e3342f84ba..801633585d 100644
--- a/ratis-proto/pom.xml
+++ b/ratis-proto/pom.xml
@@ -175,9 +175,5 @@
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-thirdparty-misc</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>annotations-api</artifactId>
- </dependency>
</dependencies>
</project>
```
##########
pom.xml:
##########
@@ -222,6 +222,8 @@
<slf4j.version>2.0.7</slf4j.version>
<junit-bom.version>5.11.2</junit-bom.version>
+ <mockito.version>4.3.1</mockito.version>
Review Comment:
Let's also update the versions
- junit: 5.12.2
- mockito: 4.11.0 (upgrading to mockito 5 seems not easy:
https://davidvlijmincx.com/posts/upgrade-to-mockito-5/)
##########
ratis-common/src/test/java/org/apache/ratis/BaseTest.java:
##########
@@ -85,8 +83,6 @@ public void setup(TestInfo testInfo) {
+ "." + (method == null? null : method.getName());
}
- // @Before annotation is retained to support junit 4 tests.
Review Comment:
Let's also remove the other two junit 4 comments:
```diff
+++ b/ratis-common/src/test/java/org/apache/ratis/BaseTest.java
@@ -72,8 +72,6 @@ public abstract class BaseTest {
}
}
- // TODO: Junit 4 reference should be removed once all the unit tests are
migrated to Junit 5.
-
private String testCaseName;
@BeforeEach
@@ -133,7 +131,6 @@ public abstract class BaseTest {
}
public File getTestDir() {
- // This will work for both junit 4 and 5.
return new File(getClassTestDir(), testCaseName);
}
```
--
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]