Bump yangtools to 13.0.0
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / BindingDOMMountPointListenerAdapterTest.java
index 82b61b2f3106b49a2ec03f68692b13e68fb08c3a..70fb1385315e7206579df758b63940cc4b1b74d8 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.mdsal.binding.dom.adapter;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 import com.google.common.util.concurrent.MoreExecutors;
 import org.junit.Before;
@@ -22,15 +22,13 @@ import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.binding.api.MountPointService.MountPointListener;
 import org.opendaylight.mdsal.binding.dom.adapter.test.util.BindingBrokerTestFactory;
-import org.opendaylight.mdsal.binding.dom.adapter.test.util.BindingTestContext;
 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 @RunWith(MockitoJUnitRunner.StrictStubs.class)
 public class BindingDOMMountPointListenerAdapterTest {
-
-    private BindingDOMMountPointListenerAdapter<?> bindingDOMMountPointListenerAdapter;
+    private BindingDOMMountPointListenerAdapter adapter;
     private AdapterContext codec;
 
     @Mock private MountPointListener listener;
@@ -39,34 +37,33 @@ public class BindingDOMMountPointListenerAdapterTest {
 
     @Before
     public void setUp() throws Exception {
-        final BindingBrokerTestFactory testFactory = new BindingBrokerTestFactory();
+        final var testFactory = new BindingBrokerTestFactory();
         testFactory.setExecutor(MoreExecutors.newDirectExecutorService());
-        final BindingTestContext testContext = testFactory.getTestContext();
+        final var testContext = testFactory.getTestContext();
         testContext.start();
         codec = testContext.getCodec();
         doReturn(listenerRegistration).when(mountPointService).registerProvisionListener(any());
-        bindingDOMMountPointListenerAdapter =
-                new BindingDOMMountPointListenerAdapter<>(listener, codec, mountPointService);
+        adapter = new BindingDOMMountPointListenerAdapter(listener, codec, mountPointService);
     }
 
     @Test
     public void basicTest() throws Exception {
-        assertEquals(listener, bindingDOMMountPointListenerAdapter.getInstance());
-        bindingDOMMountPointListenerAdapter.close();
+        assertSame(listener, adapter.listener);
+        adapter.close();
         verify(listenerRegistration).close();
     }
 
     @Test
     public void onMountPointCreatedWithExceptionTest() throws Exception {
         reset(listener);
-        bindingDOMMountPointListenerAdapter.onMountPointCreated(YangInstanceIdentifier.empty());
-        verifyZeroInteractions(listener);
+        adapter.onMountPointCreated(YangInstanceIdentifier.of());
+        verifyNoInteractions(listener);
     }
 
     @Test
     public void onMountPointRemovedWithExceptionTest() throws Exception {
         reset(listener);
-        bindingDOMMountPointListenerAdapter.onMountPointRemoved(YangInstanceIdentifier.empty());
-        verifyZeroInteractions(listener);
+        adapter.onMountPointRemoved(YangInstanceIdentifier.of());
+        verifyNoInteractions(listener);
     }
 }
\ No newline at end of file