Merge "Added JSON and XML payloads tabs with RFC 8040 URL"
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / services / sal / SalPortServiceImplTest.java
index 8533623626d1b6d4faa83f46df9468e2061d2fe7..98de92c83adabdcf2420b46ffda782b663be1ef8 100644 (file)
@@ -13,7 +13,7 @@ import com.google.common.collect.Lists;
 import java.util.List;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
@@ -29,12 +29,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.Upda
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.UpdatePortInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.port.update.UpdatedPort;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.port.update.UpdatedPortBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 @RunWith(MockitoJUnitRunner.class)
 public class SalPortServiceImplTest extends ServiceMocking {
 
-    private static final Long DUMMY_XID = 55L;
-    private static final Long DUMMY_PORT_NUMBER = 66L;
+    private static final Uint32 DUMMY_XID = Uint32.valueOf(55L);
+    private static final Uint32 DUMMY_PORT_NUMBER = Uint32.valueOf(66L);
     private static final String DUMMY_MAC_ADDRESS = "AA:BB:CC:DD:EE:FF";
     SalPortServiceImpl salPortService;
 
@@ -45,21 +46,24 @@ public class SalPortServiceImplTest extends ServiceMocking {
     }
 
     @Test
-    public void testUpdatePort() throws Exception {
+    public void testUpdatePort() {
         salPortService.updatePort(dummyUpdatePortInput());
         verify(mockedRequestContextStack).createRequestContext();
     }
 
     @Test
-    public void testBuildRequest() throws Exception {
+    public void testBuildRequest() {
         final OfHeader ofHeader = salPortService.buildRequest(new Xid(DUMMY_XID), dummyUpdatePortInput());
     }
 
-    private UpdatePortInput dummyUpdatePortInput(){
-        org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder concretePortBuilder
-                = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder();
+    private static UpdatePortInput dummyUpdatePortInput() {
+        org.opendaylight.yang.gen.v1.urn
+                .opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder concretePortBuilder
+                = new org.opendaylight.yang.gen.v1.urn
+                .opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder();
         concretePortBuilder.setConfiguration(new PortConfig(true, true, true, true));
-        concretePortBuilder.setAdvertisedFeatures(new PortFeatures(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true));
+        concretePortBuilder.setAdvertisedFeatures(new PortFeatures(true, true, true, true, true, true, true, true,
+                true, true, true, true, true, true, true, true));
         concretePortBuilder.setPortNumber(new PortNumberUni(DUMMY_PORT_NUMBER));
         concretePortBuilder.setHardwareAddress(new MacAddress(DUMMY_MAC_ADDRESS));