You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "liuxiaocs7 (via GitHub)" <gi...@apache.org> on 2026/02/11 04:28:25 UTC

[PR] HBASE-29887 Upgrade hbase-hbtop to use junit5 [hbase]

liuxiaocs7 opened a new pull request, #7734:
URL: https://github.com/apache/hbase/pull/7734

   - see: HBASE-29887


-- 
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: issues-unsubscribe@hbase.apache.org

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


Re: [PR] HBASE-29887 Upgrade hbase-hbtop to use junit5 [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid merged PR #7734:
URL: https://github.com/apache/hbase/pull/7734


-- 
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: issues-unsubscribe@hbase.apache.org

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


Re: [PR] HBASE-29887 Upgrade hbase-hbtop to use junit5 [hbase]

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on PR #7734:
URL: https://github.com/apache/hbase/pull/7734#issuecomment-3936461373

   > Can you please raise a backport PR to `branch-2`?
   
   Hi, backport PR for `branch-2` has been created(https://github.com/apache/hbase/pull/7775), please take a look when free, thanks!


-- 
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: issues-unsubscribe@hbase.apache.org

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


Re: [PR] HBASE-29887 Upgrade hbase-hbtop to use junit5 [hbase]

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on code in PR #7734:
URL: https://github.com/apache/hbase/pull/7734#discussion_r2791359081


##########
hbase-hbtop/src/test/java/org/apache/hadoop/hbase/hbtop/screen/top/TestTopScreenModel.java:
##########
@@ -36,32 +36,27 @@
 import org.apache.hadoop.hbase.hbtop.field.FieldValue;
 import org.apache.hadoop.hbase.hbtop.mode.Mode;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 
-@Category(SmallTests.class)
-@RunWith(MockitoJUnitRunner.class)
+@Tag(SmallTests.TAG)
+@ExtendWith(MockitoExtension.class)
 public class TestTopScreenModel {
 
-  @ClassRule
-  public static final HBaseClassTestRule CLASS_RULE =
-    HBaseClassTestRule.forClass(TestTopScreenModel.class);
-
   @Mock
   private Admin admin;
 
   private TopScreenModel topScreenModel;
 
   private List<Field> fields;
 
-  @Before
+  @BeforeEach
   public void setup() throws IOException {
-    when(admin.getClusterMetrics()).thenReturn(TestUtils.createDummyClusterMetrics());
+    lenient().when(admin.getClusterMetrics()).thenReturn(TestUtils.createDummyClusterMetrics());

Review Comment:
   JUnit 5 performs stricter checks here.



-- 
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: issues-unsubscribe@hbase.apache.org

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


Re: [PR] HBASE-29887 Upgrade hbase-hbtop to use junit5 [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #7734:
URL: https://github.com/apache/hbase/pull/7734#issuecomment-3883111937

   Can you please raise a backport PR to `branch-2`?


-- 
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: issues-unsubscribe@hbase.apache.org

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


Re: [PR] HBASE-29887 Upgrade hbase-hbtop to use junit5 [hbase]

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on code in PR #7734:
URL: https://github.com/apache/hbase/pull/7734#discussion_r2791360910


##########
hbase-hbtop/pom.xml:
##########
@@ -63,14 +63,9 @@
       <artifactId>junit-jupiter-params</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.junit.vintage</groupId>
-      <artifactId>junit-vintage-engine</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
+      <artifactId>mockito-junit-jupiter</artifactId>

Review Comment:
   We need to change this `mockito` dependency during the migration. cc @Apache9 



-- 
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: issues-unsubscribe@hbase.apache.org

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