*/
package org.opendaylight.openflowplugin.impl.connection;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyShort;
+
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.Futures;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
resultFeatures = RpcResultBuilder.success(new GetFeaturesOutputBuilder().build()).build();
- Mockito.when(adapter.hello(Matchers.any(HelloInput.class)))
+ Mockito.when(adapter.hello(any(HelloInput.class)))
.thenReturn(Futures.immediateFuture(RpcResultBuilder.success((HelloOutput) null).build()));
}
LOG.warn(problem.getMessage(), problem);
}
- Mockito.verify(errorHandler, Mockito.times(expectedErrors)).handleException(Matchers.any(Throwable.class));
+ Mockito.verify(errorHandler, Mockito.times(expectedErrors)).handleException(any(Throwable.class));
}
/**
LOG.debug("testVersionNegotiation10");
Short version = OFConstants.OFP_VERSION_1_0;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(null);
LOG.debug("testVersionNegotiation10-ss");
Short version = OFConstants.OFP_VERSION_1_0;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(createHelloMessage(version, helloXid).build());
handshakeManager.shake(createHelloMessage(version, helloXid).build());
Mockito.verify(handshakeListener, Mockito.never())
- .onHandshakeSuccessful(Matchers.any(GetFeaturesOutput.class), Matchers.anyShort());
+ .onHandshakeSuccessful(any(GetFeaturesOutput.class), anyShort());
}
/**
handshakeManager.shake(createHelloMessage(version, helloXid).build());
Mockito.verify(handshakeListener, Mockito.never())
- .onHandshakeSuccessful(Matchers.any(GetFeaturesOutput.class), Matchers.anyShort());
+ .onHandshakeSuccessful(any(GetFeaturesOutput.class), anyShort());
}
/**
Short version = (short) 0x02;
Short expVersion = (short) 0x01;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(createHelloMessage(version, helloXid).build());
final Short version = (short) 0x02;
final Short expVersion = (short) 0x01;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(null);
LOG.debug("testVersionNegotiation13");
Short version = OFConstants.OFP_VERSION_1_3;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(createHelloMessage(version, helloXid).build());
LOG.debug("testVersionNegotiation13-ss");
Short version = OFConstants.OFP_VERSION_1_3;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(null);
Short version = (short) 0x06;
Short expVersion = OFConstants.OFP_VERSION_1_3;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(createHelloMessage(version, helloXid).build());
Short version = (short) 0x06;
Short expVersion = OFConstants.OFP_VERSION_1_3;
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(createHelloMessage(version, helloXid).build());
handshakeManager.shake(createHelloMessage(version, helloXid).build());
Mockito.verify(handshakeListener, Mockito.never())
- .onHandshakeSuccessful(Matchers.any(GetFeaturesOutput.class), Matchers.anyShort());
+ .onHandshakeSuccessful(any(GetFeaturesOutput.class), anyShort());
}
/**
handshakeManager.shake(createHelloMessage(version, helloXid).build());
Mockito.verify(handshakeListener, Mockito.never())
- .onHandshakeSuccessful(Matchers.any(GetFeaturesOutput.class), Matchers.anyShort());
+ .onHandshakeSuccessful(any(GetFeaturesOutput.class), anyShort());
}
/**
HelloMessageBuilder helloMessage = createHelloMessage(version, helloXid);
addVersionBitmap(Lists.newArrayList((short) 0x05, OFConstants.OFP_VERSION_1_0), helloMessage);
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(helloMessage.build());
HelloMessageBuilder helloMessage = createHelloMessage(version, helloXid);
addVersionBitmap(Lists.newArrayList((short) 0x05, OFConstants.OFP_VERSION_1_0), helloMessage);
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(null);
HelloMessageBuilder helloMessage = createHelloMessage(version, helloXid);
addVersionBitmap(Lists.newArrayList((short) 0x05, OFConstants.OFP_VERSION_1_3), helloMessage);
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(helloMessage.build());
HelloMessageBuilder helloMessage = createHelloMessage(version, helloXid);
addVersionBitmap(Lists.newArrayList((short) 0x05, OFConstants.OFP_VERSION_1_3), helloMessage);
- Mockito.when(adapter.getFeatures(Matchers.any(GetFeaturesInput.class)))
+ Mockito.when(adapter.getFeatures(any(GetFeaturesInput.class)))
.thenReturn(Futures.immediateFuture(resultFeatures));
handshakeManager.shake(null);
handshakeManager.shake(helloMessage.build());
Mockito.verify(handshakeListener, Mockito.never())
- .onHandshakeSuccessful(Matchers.any(GetFeaturesOutput.class), Matchers.anyShort());
+ .onHandshakeSuccessful(any(GetFeaturesOutput.class), anyShort());
}
/**
handshakeManager.shake(helloMessage.build());
Mockito.verify(handshakeListener, Mockito.never())
- .onHandshakeSuccessful(Matchers.any(GetFeaturesOutput.class), Matchers.anyShort());
+ .onHandshakeSuccessful(any(GetFeaturesOutput.class), anyShort());
}