Remove redundant exception declarations
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / mastership / MastershipChangeServiceManagerImplTest.java
index 6b3a996a3cbc44ec00d0eac21fa8470292a87d55..dc1faa98d119e3803f29a813da09c4b10d348acb 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.mastership;
 
+import com.google.common.util.concurrent.Futures;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Assert;
@@ -41,7 +42,7 @@ public class MastershipChangeServiceManagerImplTest {
     @Mock
     private ReconciliationFrameworkEvent secondEvent;
 
-    final private MastershipChangeServiceManager manager = new MastershipChangeServiceManagerImpl();
+    private final MastershipChangeServiceManager manager = new MastershipChangeServiceManagerImpl();
     private MastershipChangeRegistration registration;
     private ReconciliationFrameworkRegistration registrationRF;
 
@@ -49,15 +50,17 @@ public class MastershipChangeServiceManagerImplTest {
     public void setUp() throws Exception {
         registration = manager.register(service);
         registrationRF = manager.reconciliationFrameworkRegistration(event);
+
+        Mockito.when(event.onDeviceDisconnected(Mockito.any())).thenReturn(Futures.immediateFuture(null));
     }
 
     @Test
-    public void register() throws Exception {
+    public void register() {
         Assert.assertNotNull(registration);
     }
 
     @Test
-    public void registerTwice() throws Exception {
+    public void registerTwice() {
         MastershipChangeRegistration registration2;
         registration2 = manager.register(secondService);
         Assert.assertNotNull(registration);
@@ -76,7 +79,7 @@ public class MastershipChangeServiceManagerImplTest {
     }
 
     @Test
-    public void reconciliationFrameworkRegistration() throws Exception {
+    public void reconciliationFrameworkRegistration() {
         Assert.assertNotNull(registrationRF);
     }
 
@@ -94,7 +97,7 @@ public class MastershipChangeServiceManagerImplTest {
     }
 
     @Test
-    public void becomeMaster() throws Exception {
+    public void becomeMaster() {
         manager.becomeMaster(deviceInfo);
         Mockito.verify(service).onBecomeOwner(deviceInfo);
         manager.becomeSlaveOrDisconnect(deviceInfo);
@@ -102,7 +105,7 @@ public class MastershipChangeServiceManagerImplTest {
     }
 
     @Test
-    public void becomeMasterBeforeDS() throws Exception {
+    public void becomeMasterBeforeDS() {
         manager.becomeMasterBeforeSubmittedDS(deviceInfo);
         Mockito.verify(event).onDevicePrepared(deviceInfo);
     }
@@ -115,7 +118,7 @@ public class MastershipChangeServiceManagerImplTest {
     }
 
     @Test
-    public void evokeEventAfterRegistration() throws Exception {
+    public void evokeEventAfterRegistration() {
         List<DeviceInfo> deviceInfos = new ArrayList<>();
         deviceInfos.add(deviceInfo);
         manager.setMasterChecker(masterChecker);