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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]