X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=netconf.git;a=blobdiff_plain;f=apps%2Fnetconf-topology%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftopology%2Fspi%2FNetconfDeviceTopologyAdapterTest.java;fp=apps%2Fnetconf-topology%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftopology%2Fspi%2FNetconfDeviceTopologyAdapterTest.java;h=d5c4ca1df955d4e6ca94fb66513aad090a6bdd26;hp=08b604e24801d9151831fc611598c2dba05536f0;hb=c69be98502c32c0b7be96df37a78ca31dabe9ecf;hpb=fb9d3a1553bfaf2f00ed1183b5f12612f3770a86 diff --git a/apps/netconf-topology/src/test/java/org/opendaylight/netconf/topology/spi/NetconfDeviceTopologyAdapterTest.java b/apps/netconf-topology/src/test/java/org/opendaylight/netconf/topology/spi/NetconfDeviceTopologyAdapterTest.java index 08b604e248..d5c4ca1df9 100644 --- a/apps/netconf-topology/src/test/java/org/opendaylight/netconf/topology/spi/NetconfDeviceTopologyAdapterTest.java +++ b/apps/netconf-topology/src/test/java/org/opendaylight/netconf/topology/spi/NetconfDeviceTopologyAdapterTest.java @@ -7,9 +7,9 @@ */ package org.opendaylight.netconf.topology.spi; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doNothing; @@ -21,13 +21,13 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import java.net.InetSocketAddress; import java.util.concurrent.ExecutionException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.binding.api.TransactionChain; import org.opendaylight.mdsal.binding.api.WriteTransaction; @@ -47,8 +47,8 @@ import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; import org.opendaylight.yangtools.yang.common.Empty; import org.opendaylight.yangtools.yang.common.Uint32; -@RunWith(MockitoJUnitRunner.StrictStubs.class) -public class NetconfDeviceTopologyAdapterTest { +@ExtendWith(MockitoExtension.class) +class NetconfDeviceTopologyAdapterTest { private static final KeyedInstanceIdentifier TEST_TOPOLOGY_ID = // FIXME: do not use this constant NetconfNodeUtils.DEFAULT_TOPOLOGY_IID; @@ -65,8 +65,8 @@ public class NetconfDeviceTopologyAdapterTest { private NetconfDeviceTopologyAdapter adapter; - @Before - public void before() { + @BeforeEach + void before() { doReturn(mockTx).when(mockChain).newWriteOnlyTransaction(); // FIXME: exact match doNothing().when(mockTx).put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), @@ -80,7 +80,7 @@ public class NetconfDeviceTopologyAdapterTest { } @Test - public void replaceChainIfFailed() { + void replaceChainIfFailed() { doNothing().when(mockChain).close(); doReturn("mockChain").when(mockChain).toString(); adapter.onFailure(new Exception("chain failed")); @@ -88,7 +88,7 @@ public class NetconfDeviceTopologyAdapterTest { } @Test - public void testFailedDevice() { + void testFailedDevice() { // FIXME: exact match doNothing().when(mockTx).put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(NetconfNode.class)); @@ -102,7 +102,7 @@ public class NetconfDeviceTopologyAdapterTest { } @Test - public void testDeviceUpdate() throws Exception { + void testDeviceUpdate() throws Exception { // FIXME: exact match doNothing().when(mockTx).put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(NetconfNode.class)); @@ -114,7 +114,7 @@ public class NetconfDeviceTopologyAdapterTest { } @Test - public void testRemoveDeviceConfiguration() throws Exception { + void testRemoveDeviceConfiguration() throws Exception { // FIXME: exact match doNothing().when(mockTx).delete(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class)); doNothing().when(mockChain).close(); @@ -137,7 +137,7 @@ public class NetconfDeviceTopologyAdapterTest { } @Test - public void testShutdownCompletion() throws Exception { + void testShutdownCompletion() throws Exception { // FIXME: exact match doNothing().when(mockTx).delete(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class)); doNothing().when(mockChain).close();