package org.opendaylight.openflowplugin.impl.statistics.services.direct;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+
+import java.math.BigInteger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.TranslatorLibrary;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-import java.math.BigInteger;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
-
@RunWith(MockitoJUnitRunner.class)
public abstract class AbstractDirectStatisticsServiceTest {
protected static final Long PORT_NO = 1L;
@Mock
protected DeviceState deviceState;
@Mock
+ protected DeviceInfo deviceInfo;
+ @Mock
protected GetFeaturesOutput getFeaturesOutput;
protected NodeConnectorId nodeConnectorId;
when(deviceContext.getMultiMsgCollector(any())).thenReturn(multiMsgCollector);
when(deviceContext.oook()).thenReturn(translatorLibrary);
when(deviceContext.getDeviceState()).thenReturn(deviceState);
- when(deviceContext.getDeviceState()).thenReturn(deviceState);
- when(deviceState.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
- when(deviceState.getNodeId()).thenReturn(new NodeId(NODE_ID));
- when(deviceState.getVersion()).thenReturn(OF_VERSION);
- when(deviceState.getFeatures()).thenReturn(getFeaturesOutput);
+ when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
+ when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
+ when(deviceInfo.getNodeId()).thenReturn(new NodeId(NODE_ID));
+ when(deviceInfo.getVersion()).thenReturn(OF_VERSION);
+ when(deviceInfo.getDatapathId()).thenReturn(DATAPATH_ID);
when(getFeaturesOutput.getVersion()).thenReturn(OF_VERSION);
when(getFeaturesOutput.getDatapathId()).thenReturn(DATAPATH_ID);
when(connectionContext.getFeatures()).thenReturn(features);