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;
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;
}
@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));