* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.device.initialization;
import static org.mockito.ArgumentMatchers.any;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPortBuilder;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
@RunWith(MockitoJUnitRunner.class)
public class OF10DeviceInitializerTest {
private AbstractDeviceInitializer deviceInitializer;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final KeyedInstanceIdentifier<Node, NodeKey> nodeInstanceIdentifier = DeviceStateUtil
.createNodeInstanceIdentifier(new NodeId("openflow:1"));
when(featuresReply.getCapabilitiesV10()).thenReturn(capabilitiesV10);
when(featuresReply.getPhyPort()).thenReturn(Collections
.singletonList(new PhyPortBuilder()
- .setPortNo(42L)
+ .setPortNo(Uint32.valueOf(42))
.build()));
when(connectionContext.getFeatures()).thenReturn(featuresReply);
when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
when(translatorLibrary.lookupTranslator(any())).thenReturn(messageTranslator);
when(deviceContext.oook()).thenReturn(translatorLibrary);
- when(requestContext.getXid()).thenReturn(new Xid(42L));
+ when(requestContext.getXid()).thenReturn(new Xid(Uint32.valueOf(42L)));
when(requestContext.getFuture()).thenReturn(RpcResultBuilder.success().buildFuture());
when(deviceContext.createRequestContext()).thenReturn(requestContext);
when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);