Use simple Registration in ClusterSingletonServiceProvider
[mdsal.git] / singleton-service / mdsal-singleton-dom-impl / src / test / java / org / opendaylight / mdsal / singleton / dom / impl / AsyncEOSClusterSingletonServiceProviderTest.java
index b0a6324cccd7cd3bbf6b8515822b0be0df3f8fd8..871ca7c9c65ba0db1a6b40cda4865a6137a96100 100644 (file)
@@ -26,7 +26,6 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 
 /*
  * Testing {@link DOMClusterSingletonServiceProviderImpl} implementation
@@ -77,8 +76,7 @@ public final class AsyncEOSClusterSingletonServiceProviderTest extends AbstractE
      */
     @Test
     public void takeDoubleLeadershipClusterSingletonServiceTest() throws Exception {
-        final ClusterSingletonServiceRegistration reg = clusterSingletonServiceProvider
-                .registerClusterSingletonService(clusterSingletonService);
+        final var reg = clusterSingletonServiceProvider.registerClusterSingletonService(clusterSingletonService);
         assertNotNull(reg);
         verify(mockEos).registerCandidate(ENTITY);
         clusterSingletonServiceProvider.ownershipChanged(ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
@@ -107,8 +105,7 @@ public final class AsyncEOSClusterSingletonServiceProviderTest extends AbstractE
      */
     @Test
     public void unexpectedLostLeadershipDoubleCandidateTest() throws Exception {
-        final ClusterSingletonServiceRegistration reg = clusterSingletonServiceProvider
-                .registerClusterSingletonService(clusterSingletonService);
+        final var reg = clusterSingletonServiceProvider.registerClusterSingletonService(clusterSingletonService);
         assertNotNull(reg);
         verify(mockEos).registerCandidate(ENTITY);
         clusterSingletonServiceProvider.ownershipChanged(ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
@@ -137,8 +134,7 @@ public final class AsyncEOSClusterSingletonServiceProviderTest extends AbstractE
      */
     @Test
     public void inJeopardyMasterTest() throws Exception {
-        final ClusterSingletonServiceRegistration reg = clusterSingletonServiceProvider
-                .registerClusterSingletonService(clusterSingletonService);
+        final var reg = clusterSingletonServiceProvider.registerClusterSingletonService(clusterSingletonService);
         assertNotNull(reg);
         verify(mockEos).registerCandidate(ENTITY);
         clusterSingletonServiceProvider.ownershipChanged(ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
@@ -160,14 +156,13 @@ public final class AsyncEOSClusterSingletonServiceProviderTest extends AbstractE
     }
 
     /**
-     * Test checks close processing for {@link ClusterSingletonServiceRegistration}.
+     * Test checks close processing for {@link ServiceRegistration}.
      *
      * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationMasterTest() throws Exception {
-        final ClusterSingletonServiceRegistration reg = clusterSingletonServiceProvider
-                .registerClusterSingletonService(clusterSingletonService);
+        final var reg = clusterSingletonServiceProvider.registerClusterSingletonService(clusterSingletonService);
         assertNotNull(reg);
         assertEquals(TestClusterSingletonServiceState.INITIALIZED, clusterSingletonService.getServiceState());
         verify(mockEos).registerCandidate(ENTITY);
@@ -186,14 +181,13 @@ public final class AsyncEOSClusterSingletonServiceProviderTest extends AbstractE
     }
 
     /**
-     * Test checks close processing for {@link ClusterSingletonServiceRegistration}.
+     * Test checks close processing for {@link ServiceRegistration}.
      *
      * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationMasterCloseWithNotificationTimesTest() throws Exception {
-        final ClusterSingletonServiceRegistration reg = clusterSingletonServiceProvider
-                .registerClusterSingletonService(clusterSingletonService);
+        final var reg = clusterSingletonServiceProvider.registerClusterSingletonService(clusterSingletonService);
         assertNotNull(reg);
         assertEquals(TestClusterSingletonServiceState.INITIALIZED, clusterSingletonService.getServiceState());
         verify(mockEos).registerCandidate(ENTITY);
@@ -212,14 +206,13 @@ public final class AsyncEOSClusterSingletonServiceProviderTest extends AbstractE
     }
 
     /**
-     * Test checks close processing for {@link ClusterSingletonServiceRegistration}.
+     * Test checks close processing for {@link ServiceRegistration}.
      *
      * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationMasterCloseCoupleTimesTest() throws Exception {
-        final ClusterSingletonServiceRegistration reg = clusterSingletonServiceProvider
-                .registerClusterSingletonService(clusterSingletonService);
+        final var reg = clusterSingletonServiceProvider.registerClusterSingletonService(clusterSingletonService);
         assertNotNull(reg);
         assertEquals(TestClusterSingletonServiceState.INITIALIZED, clusterSingletonService.getServiceState());
         verify(mockEos).registerCandidate(ENTITY);