Convert TapiLinkImpl into a Component
[transportpce.git] / tapi / src / test / java / org / opendaylight / transportpce / tapi / topology / TapiTopologyImplExceptionTest.java
index 9f4f466e73e0ed9a37fe76e736cb3dcc3ab090e2..7fb3b598f1a347eb8921fe8f64338ccab12fd141 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.transportpce.tapi.topology;
 
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -17,7 +17,7 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import org.eclipse.jdt.annotation.NonNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mock;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
@@ -29,6 +29,7 @@ import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.transportpce.tapi.TapiStringConstants;
 import org.opendaylight.transportpce.tapi.utils.TapiContext;
 import org.opendaylight.transportpce.tapi.utils.TapiLink;
+import org.opendaylight.transportpce.tapi.utils.TapiLinkImpl;
 import org.opendaylight.transportpce.tapi.utils.TapiTopologyDataUtils;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.GetTopologyDetailsInput;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.GetTopologyDetailsOutput;
@@ -39,14 +40,14 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 
 public class TapiTopologyImplExceptionTest {
     @Mock
-    TapiContext tapiContext;
+    private TapiContext tapiContext;
     @Mock
-    TopologyUtils topologyUtils;
+    private TopologyUtils topologyUtils;
     @Mock
-    TapiLink tapiLink;
+    private TapiLink tapiLink;
 
     @Test
-    public void getTopologyDetailsWithExceptionTest() throws InterruptedException, ExecutionException {
+    void getTopologyDetailsWithExceptionTest() throws InterruptedException, ExecutionException {
         DataBroker dataBroker = mock(DataBroker.class);
         when(dataBroker.newReadOnlyTransaction())
                 .thenReturn(new ReadTransactionMock());
@@ -61,7 +62,7 @@ public class TapiTopologyImplExceptionTest {
         };
         when(networkTransactionService.commit()).then(answer);
         tapiContext = new TapiContext(networkTransactionService);
-        tapiLink = new TapiLink(networkTransactionService);
+        tapiLink = new TapiLinkImpl(networkTransactionService);
 
         GetTopologyDetailsInput input = TapiTopologyDataUtils.buildGetTopologyDetailsInput(
             TapiStringConstants.T0_MULTILAYER);
@@ -70,9 +71,9 @@ public class TapiTopologyImplExceptionTest {
         RpcResult<GetTopologyDetailsOutput> rpcResult = result.get();
         if (rpcResult.isSuccessful()) {
             Topology topology = rpcResult.getResult().getTopology();
-            assertNull("Topology should be null", topology);
+            assertNull(topology, "Topology should be null");
         } else {
-            assertNull("Topology should be null", null);
+            assertNull(null, "Topology should be null");
         }
     }
 
@@ -102,5 +103,4 @@ public class TapiTopologyImplExceptionTest {
             // TODO Auto-generated method stub
         }
     }
-
-}
+}
\ No newline at end of file