Eliminate use of deprecated mockito methods
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / test / java / org / opendaylight / controller / cluster / messaging / AbstractMessagingTest.java
index 5ff1f38e838d297488b4f42b88205bd45fd6a220..ff1d5f87e1460ca08688a5a7de85dbe42a94a472 100644 (file)
@@ -7,14 +7,14 @@
  */
 package org.opendaylight.controller.cluster.messaging;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 
 import akka.actor.ActorSystem;
-import akka.testkit.JavaTestKit;
 import akka.testkit.TestProbe;
+import akka.testkit.javadsl.TestKit;
 import com.google.common.io.ByteSource;
 import java.io.IOException;
 import java.io.InputStream;
@@ -50,7 +50,7 @@ public class AbstractMessagingTest {
     protected InputStream mockInputStream;
 
     @BeforeClass
-    public static void setupClass() throws IOException {
+    public static void setupClass() {
         ACTOR_SYSTEM = ActorSystem.create("test");
     }
 
@@ -71,16 +71,16 @@ public class AbstractMessagingTest {
 
     @AfterClass
     public static void tearDownClass() {
-        JavaTestKit.shutdownActorSystem(ACTOR_SYSTEM, Boolean.TRUE);
+        TestKit.shutdownActorSystem(ACTOR_SYSTEM, true);
     }
 
-    void setupMockFiledBackedStream(final FileBackedOutputStream mockFiledBackedStream) throws IOException {
-        doNothing().when(mockFiledBackedStream).write(any(byte[].class), anyInt(), anyInt());
-        doNothing().when(mockFiledBackedStream).write(any(byte[].class));
-        doNothing().when(mockFiledBackedStream).write(anyInt());
-        doNothing().when(mockFiledBackedStream).close();
-        doNothing().when(mockFiledBackedStream).cleanup();
-        doNothing().when(mockFiledBackedStream).flush();
-        doReturn(mockByteSource).when(mockFiledBackedStream).asByteSource();
+    void setupMockFiledBackedStream(final FileBackedOutputStream mockOutputStream) throws IOException {
+        doNothing().when(mockOutputStream).write(any(byte[].class), anyInt(), anyInt());
+        doNothing().when(mockOutputStream).write(any(byte[].class));
+        doNothing().when(mockOutputStream).write(anyInt());
+        doNothing().when(mockOutputStream).close();
+        doNothing().when(mockOutputStream).cleanup();
+        doNothing().when(mockOutputStream).flush();
+        doReturn(mockByteSource).when(mockOutputStream).asByteSource();
     }
 }