Skip to content

Commit 9c877e4

Browse files
author
Xing Lin
committed
HDFS-17118 Fixed a couple checkstyle warnings in TestObserverReadProxyProvider
1 parent 4d4b099 commit 9c877e4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverReadProxyProvider.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.junit.BeforeClass;
4747
import org.junit.Test;
4848
import org.mockito.Mockito;
49-
import org.mockito.MockitoAnnotations;
5049
import org.mockito.invocation.InvocationOnMock;
5150
import org.mockito.stubbing.Answer;
5251
import org.slf4j.event.Level;
@@ -59,8 +58,8 @@
5958
import static org.junit.Assert.assertNull;
6059
import static org.junit.Assert.assertTrue;
6160
import static org.junit.Assert.fail;
62-
import static org.mockito.Matchers.any;
63-
import static org.mockito.Matchers.anyLong;
61+
import static org.mockito.ArgumentMatchers.any;
62+
import static org.mockito.ArgumentMatchers.anyLong;
6463
import static org.mockito.Mockito.mock;
6564
import static org.mockito.Mockito.verifyNoMoreInteractions;
6665
import static org.mockito.Mockito.when;
@@ -367,7 +366,7 @@ public void testGetHAServiceStateWithTimeout() throws Exception {
367366

368367
setupProxyProvider(1, NAMENODE_HA_STATE_PROBE_TIMEOUT_SHORT);
369368
final HAServiceState state = HAServiceState.STANDBY;
370-
NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
369+
@SuppressWarnings("unchecked") NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
371370
(NNProxyInfo<ClientProtocol>) mock(NNProxyInfo.class);
372371
Future<HAServiceState> task = mock(Future.class);
373372
when(task.get(anyLong(), any(TimeUnit.class))).thenReturn(state);
@@ -452,7 +451,7 @@ public void testExecutionExceptionGetHAServiceStateWithTimeout() throws Exceptio
452451
}
453452

454453
/**
455-
* Test GetHAServiceState when timeout is disabled (test the else { task.get() } code path)
454+
* Test GetHAServiceState when timeout is disabled (test the else { task.get() } code path).
456455
*/
457456
@Test
458457
public void testGetHAServiceStateWithoutTimeout() throws Exception {

0 commit comments

Comments
 (0)