<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>applications</artifactId>
<groupId>org.opendaylight.openflowplugin</groupId>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>applications</artifactId>
<groupId>org.opendaylight.openflowplugin</groupId>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
public Boolean call() {
InstanceIdentifier<FlowCapableNode> nodeIdentity = deviceInfo.getNodeInstanceIdentifier()
.augmentation(FlowCapableNode.class);
- String node = nodeIdentity.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
+ String node = nodeIdentity.firstKeyOf(Node.class).getId().getValue();
BundleId bundleIdValue = new BundleId(BUNDLE_ID.getAndIncrement());
LOG.debug("Triggering arbitrator reconciliation for device :{}", node);
final NodeRef nodeRef = new NodeRef(nodeIdentity.firstIdentifierOf(Node.class));
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>applications</artifactId>
<groupId>org.opendaylight.openflowplugin</groupId>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
<?xml version="1.0"?>
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
}
} catch (ReadFailedException e) {
readOpStatus.set(FlowCounter.OperationStatus.FAILURE.status());
- LOG.error(e.getMessage(), e);
+ LOG.error("Error {}", e);
}
}
}
TimeUnit.MILLISECONDS.sleep(PAUSE_BETWEEN_BATCH_MILLIS);
} catch (InterruptedException iEx) {
- LOG.error("Interrupted while pausing after batched push upto {}. Ex {}", i, iEx);
+ LOG.error("Interrupted while pausing after batched push upto {} Ex ", i, iEx);
}
}
}
@Override
public void onTransactionChainFailed(TransactionChain<?, ?> transactionChain,
AsyncTransaction<?, ?> asyncTransaction, Throwable throwable) {
- LOG.error("Transaction chain: {} FAILED at asyncTransaction: {} due to: {}", transactionChain,
+ LOG.error("Transaction chain: {} FAILED at asyncTransaction: {} due to: ", transactionChain,
asyncTransaction.getIdentifier(), throwable);
transactionChain.close();
}
} catch (MalformedObjectNameException | InstanceAlreadyExistsException | MBeanRegistrationException
| NotCompliantMBeanException e) {
rpcResultBuilder = RpcResultBuilder.failed();
- LOG.warn("Exception occurred: {} ", e.getMessage(), e);
+ LOG.warn("Exception occurred: {} ", e);
}
return Futures.immediateFuture(rpcResultBuilder.build());
}
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(Matchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
flowWriterConcurrent = new FlowWriterConcurrent(mockDataBroker, mockFlowPusher);
}
@Test
public void testAddFlows() throws Exception {
flowWriterConcurrent.addFlows(1, FLOWS_PER_DPN, 10, 10, 10, (short) 0, (short) 1, true);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any(), Matchers.<DataObject>any(), Matchers.anyBoolean());
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ ArgumentMatchers.anyBoolean());
}
@Test
public void testDeleteFlows() throws Exception {
flowWriterConcurrent.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).delete(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any());
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
+ .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
package org.opendaylight.openflowplugin.applications.bulk.o.matic;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.doAnswer(invocation -> {
((Runnable)invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(Matchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
flowWriterDirectOFRpc = new FlowWriterDirectOFRpc(mockDataBroker, mockSalFlowService, mockFlowPusher);
}
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(Matchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
flowWriterSequential = new FlowWriterSequential(mockDataBroker, mockFlowPusher);
}
@Test
public void testAddFlows() throws Exception {
flowWriterSequential.addFlows(1, FLOWS_PER_DPN, 10, 10, (short) 0, (short) 1, true);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any(), Matchers.<DataObject>any(), Matchers.anyBoolean());
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ ArgumentMatchers.anyBoolean());
}
@Test
public void testDeleteFlows() throws Exception {
flowWriterSequential.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).delete(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any());
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
+ .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(Matchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
final BindingTransactionChain mockedTxChain = mock(BindingTransactionChain.class);
when(mockedTxChain.newWriteOnlyTransaction()).thenReturn(writeTransaction);
- doReturn(mockedTxChain).when(mockDataBroker).createTransactionChain(Matchers.<TransactionChainListener>any());
+ doReturn(mockedTxChain).when(mockDataBroker)
+ .createTransactionChain(ArgumentMatchers.<TransactionChainListener>any());
when(writeTransaction.submit()).thenReturn(Futures.immediateCheckedFuture(null));
@Test
public void testAddFlows() throws Exception {
flowWriterTxChain.addFlows(1, FLOWS_PER_DPN, 10, 10, 10, (short) 0, (short) 1, true);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any(), Matchers.<DataObject>any(), Matchers.anyBoolean());
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ ArgumentMatchers.anyBoolean());
}
@Test
public void testDeleteFlows() throws Exception {
flowWriterTxChain.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).delete(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any());
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
+ .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
public void setUp() throws Exception {
when(mockDataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
when(mockDataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
- when(readOnlyTransaction.read(Mockito.any(LogicalDatastoreType.class), Mockito.<InstanceIdentifier<Node>>any()))
+ Mockito.lenient().when(readOnlyTransaction.read(Mockito.any(LogicalDatastoreType.class),
+ Mockito.<InstanceIdentifier<Node>>any()))
.thenReturn(Futures.immediateCheckedFuture(Optional.of(mockNode)));
salBulkFlowService = new SalBulkFlowServiceImpl(mockSalFlowService, mockDataBroker);
}
salBulkFlowService.addFlowsDs(addFlowsDsInput);
verify(writeTransaction).submit();
- verify(writeTransaction).put(Matchers.<LogicalDatastoreType>any(), Matchers.<InstanceIdentifier<Flow>>any(),
+ verify(writeTransaction).put(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
flowArgumentCaptor.capture(), Mockito.anyBoolean());
Flow flow = flowArgumentCaptor.getValue();
final RemoveFlowsDsInput removeFlowsDsInput = removeFlowsDsInputBuilder.build();
salBulkFlowService.removeFlowsDs(removeFlowsDsInput);
- verify(writeTransaction).delete(Matchers.<LogicalDatastoreType>any(), Matchers.<InstanceIdentifier<Flow>>any());
+ verify(writeTransaction).delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<Flow>>any());
verify(writeTransaction, times(2)).submit();
}
@Test
public void testAddRemoveFlowsRpc() throws Exception {
- Mockito.when(mockSalFlowService.addFlow(Matchers.<AddFlowInput>any()))
+ Mockito.when(mockSalFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
- Mockito.when(mockSalFlowService.removeFlow(Matchers.<RemoveFlowInput>any()))
+ Mockito.when(mockSalFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
.thenReturn(RpcResultBuilder.success(new RemoveFlowOutputBuilder().build()).buildFuture());
final BulkFlowItemBuilder bulkFlowItemBuilder = new BulkFlowItemBuilder();
final AddFlowsRpcInput addFlowsRpcInput = addFlowsRpcInputBuilder.build();
salBulkFlowService.addFlowsRpc(addFlowsRpcInput);
- verify(mockSalFlowService).addFlow(Matchers.<AddFlowInput>any());
+ verify(mockSalFlowService).addFlow(ArgumentMatchers.<AddFlowInput>any());
final RemoveFlowsRpcInputBuilder removeFlowsRpcInputBuilder = new RemoveFlowsRpcInputBuilder();
removeFlowsRpcInputBuilder.setBulkFlowItem(bulkFlowItems);
final RemoveFlowsRpcInput removeFlowsRpcInput = removeFlowsRpcInputBuilder.build();
salBulkFlowService.removeFlowsRpc(removeFlowsRpcInput);
- verify(mockSalFlowService).removeFlow(Matchers.<RemoveFlowInput>any());
+ verify(mockSalFlowService).removeFlow(ArgumentMatchers.<RemoveFlowInput>any());
}
@Test
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockTablePusher).execute(Matchers.<Runnable>any());
+ }).when(mockTablePusher).execute(ArgumentMatchers.<Runnable>any());
tableWriter = new TableWriter(mockDataBroker, mockTablePusher);
}
@Test
public void testAddTables() throws Exception {
tableWriter.addTables(DPN_COUNT, START_TABLE_ID, END_TABLE_ID);
- Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN)).put(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any(), Matchers.<DataObject>any(), Matchers.anyBoolean());
+ Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN))
+ .put(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ ArgumentMatchers.anyBoolean());
}
@Test
public void testDeleteTables() throws Exception {
tableWriter.deleteTables(DPN_COUNT, START_TABLE_ID, END_TABLE_ID);
- Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN)).delete(Matchers.<LogicalDatastoreType>any(),
- Matchers.<InstanceIdentifier<DataObject>>any());
+ Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN))
+ .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>applications</artifactId>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>mdsal-eos-binding-api</artifactId>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
*/
package org.opendaylight.openflowplugin.applications.deviceownershipservice.impl;
-import com.google.common.base.Optional;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.regex.Pattern;
import org.slf4j.LoggerFactory;
public class DeviceOwnershipServiceImpl implements DeviceOwnershipService, EntityOwnershipListener {
- private static final Logger LOG = LoggerFactory.getLogger(DeviceOwnershipService.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DeviceOwnershipServiceImpl.class);
private static final String SERVICE_ENTITY_TYPE = "org.opendaylight.mdsal.ServiceEntityType";
private static final Pattern NODE_ID_PATTERN = Pattern.compile("^openflow:\\d+");
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
public void remove(final InstanceIdentifier<Flow> identifier, final Flow flow,
final InstanceIdentifier<FlowCapableNode> nodeIdent, final BundleId bundleId) {
final List<Message> messages = new ArrayList<>(1);
- String node = nodeIdent.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
+ String node = nodeIdent.firstKeyOf(Node.class).getId().getValue();
BundleInnerMessage bundleInnerMessage = new BundleRemoveFlowCaseBuilder()
.setRemoveFlowCaseData(new RemoveFlowCaseDataBuilder(flow).build()).build();
Message message = new MessageBuilder().setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)))
public void remove(final InstanceIdentifier<Flow> identifier, final Flow removeDataObj,
final InstanceIdentifier<FlowCapableNode> nodeIdent) {
- final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
+ final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
final Flow removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
Future<RpcResult<RemoveFlowOutput>> resultFuture = SettableFuture.create();
- final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
+ final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
builder.setFlowRef(new FlowRef(identifier));
public void update(final InstanceIdentifier<Flow> identifier, final Flow original, final Flow update,
final InstanceIdentifier<FlowCapableNode> nodeIdent) {
- final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
+ final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, update)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
public Future<? extends RpcResult<?>> add(final InstanceIdentifier<Flow> identifier, final Flow addDataObj,
final InstanceIdentifier<FlowCapableNode> nodeIdent) {
- final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
+ final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, addDataObj)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
if (compareInstanceIdentifierTail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
LOG.debug("Node Connector removed");
- String nodeConnectorIdentifier = nodeConnIdent.firstKeyOf(NodeConnector.class, NodeConnectorKey.class)
+ String nodeConnectorIdentifier = nodeConnIdent.firstKeyOf(NodeConnector.class)
.getId().getValue();
BigInteger dpId = getDpIdFromPortName(nodeConnectorIdentifier);
if (compareInstanceIdentifierTail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
LOG.debug("Node Connector added");
String nodeConnectorIdentifier = nodeConnIdent
- .firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue();
+ .firstKeyOf(NodeConnector.class).getId().getValue();
BigInteger dpId = getDpIdFromPortName(nodeConnectorIdentifier);
if (!dpnToPortMultiMap.containsEntry(dpId, nodeConnectorIdentifier)) {
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInputBuilder;
@Override
public Boolean call() {
- String node = nodeIdentity.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
+ String node = nodeIdentity.firstKeyOf(Node.class).getId().getValue();
Optional<FlowCapableNode> flowNode = Optional.absent();
BundleId bundleIdValue = new BundleId(BUNDLE_ID.getAndIncrement());
BigInteger dpnId = getDpnIdFromNodeName(node);
@Override
public Boolean call() {
- String node = nodeIdentity.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
+ String node = nodeIdentity.firstKeyOf(Node.class).getId().getValue();
BigInteger dpnId = getDpnIdFromNodeName(node);
ReadOnlyTransaction trans = provider.getReadTranaction();
if (flowNode.get().getGroup() != null) {
for (Group gr : flowNode.get().getGroup()) {
- NodeId nodeId = nodeRef.getValue().firstKeyOf(Node.class, NodeKey.class).getId();
+ NodeId nodeId = nodeRef.getValue().firstKeyOf(Node.class).getId();
provider.getDevicesGroupRegistry().storeGroup(nodeId,gr.getGroupId().getValue());
messages.add(new MessageBuilder().setNode(nodeRef).setBundleInnerMessage(new BundleAddGroupCaseBuilder()
.setAddGroupCaseData(new AddGroupCaseDataBuilder(gr).build()).build()).build());
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
}
public static NodeId getNodeIdFromNodeIdentifier(final InstanceIdentifier<FlowCapableNode> nodeIdent) {
- return nodeIdent.firstKeyOf(Node.class, NodeKey.class).getId();
+ return nodeIdent.firstKeyOf(Node.class).getId();
}
public static String getFlowId(final FlowRef flowRef) {
- return flowRef.getValue().firstKeyOf(Flow.class, FlowKey.class).getId().getValue();
+ return flowRef.getValue().firstKeyOf(Flow.class).getId().getValue();
}
public static BigInteger getDpnIdFromNodeName(final InstanceIdentifier<FlowCapableNode> nodeIdent) {
- String nodeId = nodeIdent.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
+ String nodeId = nodeIdent.firstKeyOf(Node.class).getId().getValue();
String dpId = nodeId.substring(nodeId.lastIndexOf(SEPARATOR) + 1);
return new BigInteger(dpId);
}
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, reconciliationAgent, dataBroker,
mastershipChangeServiceManager);
deviceMastershipManager.setRoutedRpcReg(routedRpcReg);
- Mockito.when(clusterSingletonService.registerClusterSingletonService(Matchers.<ClusterSingletonService>any()))
+ Mockito.lenient().when(clusterSingletonService
+ .registerClusterSingletonService(ArgumentMatchers.<ClusterSingletonService>any()))
.thenReturn(registration);
Mockito.when(deviceInfo.getNodeId()).thenReturn(nodeId);
Mockito.when(nodeId.getValue()).thenReturn("dummyValue");
Mockito.when(configurationService.registerListener(Mockito.any())).thenReturn(() -> {
});
- Mockito.when(configurationService.getProperty(Mockito.eq("disable-reconciliation"), Mockito.any()))
+ Mockito.lenient().when(configurationService.getProperty(Mockito.eq("disable-reconciliation"), Mockito.any()))
.thenReturn(config.isDisableReconciliation());
- Mockito.when(configurationService.getProperty(Mockito.eq("stale-marking-enabled"), Mockito.any()))
+ Mockito.lenient().when(configurationService.getProperty(Mockito.eq("stale-marking-enabled"), Mockito.any()))
.thenReturn(config.isStaleMarkingEnabled());
- Mockito.when(configurationService.getProperty(Mockito.eq("reconciliation-retry-count"), Mockito.any()))
- .thenReturn(config.getReconciliationRetryCount());
+ Mockito.lenient().when(configurationService.getProperty(Mockito.eq("reconciliation-retry-count"),
+ Mockito.any())).thenReturn(config.getReconciliationRetryCount());
- Mockito.when(configurationService.getProperty(Mockito.eq("bundle-based-reconciliation-enabled"), Mockito.any()))
- .thenReturn(config.isBundleBasedReconciliationEnabled());
+ Mockito.lenient().when(configurationService.getProperty(Mockito.eq("bundle-based-reconciliation-enabled"),
+ Mockito.any())).thenReturn(config.isBundleBasedReconciliationEnabled());
return configurationService;
}
LOG.trace("Forwarding Flow REMOVE request Tbl id, node Id {} {}",
identifier, nodeIdent);
- final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
+ final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
builder.setFlowRef(new FlowRef(identifier));
identifier, nodeIdent, update);
final Future<RpcResult<UpdateFlowOutput>> output;
- final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
+ final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, update)) {
final UpdateFlowInputBuilder builder = new UpdateFlowInputBuilder();
identifier, nodeIdent, addDataObj);
final Future<RpcResult<AddFlowOutput>> output;
- final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
+ final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, addDataObj)) {
final AddFlowInputBuilder builder = new AddFlowInputBuilder(addDataObj);
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
}
public static NodeId digNodeId(final InstanceIdentifier<?> nodeIdent) {
- return nodeIdent.firstKeyOf(Node.class, NodeKey.class).getId();
+ return nodeIdent.firstKeyOf(Node.class).getId();
}
public static InstanceIdentifier<Node> digNodePath(final InstanceIdentifier<FlowCapableNode> nodeIdent) {
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void setUp() throws Exception {
- Mockito.when(rpcRegistry.getRpcService(Matchers.<Class<? extends RpcService>>any()))
+ Mockito.when(rpcRegistry.getRpcService(ArgumentMatchers.<Class<? extends RpcService>>any()))
.thenAnswer(invocation -> {
Class<? extends RpcService> serviceType =
(Class<? extends RpcService>) invocation.getArguments()[0];
provider.init();
Mockito.verify(dataBroker, Mockito.times(2)).registerDataTreeChangeListener(
- Matchers.<DataTreeIdentifier<FlowCapableNode>>any(),
- Matchers.<DataTreeChangeListener<FlowCapableNode>>any());
+ ArgumentMatchers.<DataTreeIdentifier<FlowCapableNode>>any(),
+ ArgumentMatchers.<DataTreeChangeListener<FlowCapableNode>>any());
}
@After
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.when(roTx.read(LogicalDatastoreType.OPERATIONAL, fcNodePath))
.thenReturn(Futures.immediateCheckedFuture(Optional.of(dataBefore)));
final SyncupEntry syncupEntry = new SyncupEntry(after, dsTypeAfter, before, dsTypeBefore);
- Mockito.when(reactor.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(syncupEntry)))
- .thenReturn(Futures.immediateFuture(Boolean.TRUE));
+ Mockito.when(reactor.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
+ Mockito.eq(syncupEntry))).thenReturn(Futures.immediateFuture(Boolean.TRUE));
return syncupEntry;
}
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.when(roTx.read(LogicalDatastoreType.CONFIGURATION, fcNodePath))
.thenReturn(Futures.immediateCheckedFuture(Optional.of(configNode)));
final SyncupEntry syncupEntry = new SyncupEntry(after, dsTypeAfter, before, dsTypeBefore);
- Mockito.when(reactor.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(syncupEntry)))
- .thenReturn(Futures.immediateFuture(Boolean.TRUE));
+ Mockito.when(reactor.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
+ Mockito.eq(syncupEntry))).thenReturn(Futures.immediateFuture(Boolean.TRUE));
return syncupEntry;
}
}
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.ArgumentMatchers;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final SyncupEntry zipped = new SyncupEntry(dataAfter2, configDS, dataBefore, configDS);
final List<ListenableFuture<Boolean>> allResults = new ArrayList<>();
- Mockito.when(delegate.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
+ Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
.thenAnswer(invocationOnMock -> {
LOG.info("unlocking next configs");
latchForNext.countDown();
final SyncupEntry first = new SyncupEntry(dataBefore, configDS, null, configDS);
final SyncupEntry second = new SyncupEntry(dataAfter, configDS, dataBefore, configDS);
- Mockito.when(delegate.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
+ Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
.thenAnswer(invocationOnMock -> {
LOG.info("unlocking next config");
latchForNext.countDown();
final SyncupEntry first = new SyncupEntry(configAfter, configDS, configBefore, configDS);
final SyncupEntry second = new SyncupEntry(configActual, configDS, freshOperational, operationalDS);
- Mockito.when(delegate.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
+ Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
.thenAnswer(invocationOnMock -> {
LOG.info("unlocking for fresh operational");
latchForNext.countDown();
}
private void mockSyncupWithEntry(final SyncupEntry entry) {
- Mockito.when(delegate.syncup(Matchers.any(), Mockito.eq(entry)))
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(), Mockito.eq(entry)))
.thenReturn(Futures.immediateFuture(Boolean.TRUE));
}
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
fcNodePath = nodePath.augmentation(FlowCapableNode.class);
final Node operationalNode = Mockito.mock(Node.class);
- Mockito.when(operationalNode.getId()).thenReturn(NODE_ID);
- Mockito.when(operationalNode.augmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
+ Mockito.lenient().when(operationalNode.getId()).thenReturn(NODE_ID);
+ Mockito.lenient().when(operationalNode.augmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
}
@Test
public void testSyncupSuccess() {
- Mockito.when(delegate.syncup(Matchers.any(), Matchers.any()))
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(), ArgumentMatchers.any()))
.thenReturn(Futures.immediateFuture(Boolean.TRUE));
reactor.syncup(fcNodePath, syncupEntry);
@Test
public void testSyncupFail() {
- Mockito.when(delegate.syncup(Matchers.any(), Matchers.any()))
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(), ArgumentMatchers.any()))
.thenReturn(Futures.immediateFailedFuture(new Exception()));
reactor.syncup(fcNodePath, syncupEntry);
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
operationalFcn, LogicalDatastoreType.OPERATIONAL);
Mockito.when(syncPlanPushStrategy.executeSyncStrategy(
- Matchers.<ListenableFuture<RpcResult<Void>>>any(),
- Matchers.<SynchronizationDiffInput>any(),
- Matchers.<SyncCrudCounters>any()))
+ ArgumentMatchers.<ListenableFuture<RpcResult<Void>>>any(),
+ ArgumentMatchers.<SynchronizationDiffInput>any(),
+ ArgumentMatchers.<SyncCrudCounters>any()))
.thenReturn(RpcResultBuilder.<Void>success().buildFuture());
final ListenableFuture<Boolean> syncupResult = reactor.syncup(NODE_IDENT, syncupEntry);
Assert.assertTrue(voidRpcResult);
Mockito.verify(syncPlanPushStrategy).executeSyncStrategy(
- Matchers.<ListenableFuture<RpcResult<Void>>>any(),
+ ArgumentMatchers.<ListenableFuture<RpcResult<Void>>>any(),
syncDiffInputCaptor.capture(),
- Matchers.<SyncCrudCounters>any());
+ ArgumentMatchers.<SyncCrudCounters>any());
final SynchronizationDiffInput diffInput = syncDiffInputCaptor.getValue();
Assert.assertEquals(1, ReconcileUtil.countTotalPushed(diffInput.getFlowsToAddOrUpdate().values()));
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Test
public void testSyncupSuccess() {
- Mockito.when(delegate.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Matchers.<SyncupEntry>any()))
- .thenReturn(Futures.immediateFuture(Boolean.TRUE));
+ Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
+ ArgumentMatchers.<SyncupEntry>any())).thenReturn(Futures.immediateFuture(Boolean.TRUE));
reactor.syncup(fcNodePath, syncupEntry);
@Test
public void testSyncupFail() {
- Mockito.when(delegate.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Matchers.<SyncupEntry>any()))
- .thenReturn(Futures.immediateFuture(Boolean.FALSE));
+ Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
+ ArgumentMatchers.<SyncupEntry>any())).thenReturn(Futures.immediateFuture(Boolean.FALSE));
reactor.syncup(fcNodePath, syncupEntry);
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void setUp() throws Exception {
deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, new ReconciliationRegistry());
- Mockito.when(clusterSingletonService.registerClusterSingletonService(Matchers.<ClusterSingletonService>any()))
+ Mockito.when(clusterSingletonService
+ .registerClusterSingletonService(ArgumentMatchers.<ClusterSingletonService>any()))
.thenReturn(registration);
}
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final Future<RpcResult<AddFlowOutput>> addResult = flowForwarder.add(flowPath, flow, flowCapableNodePath);
- Mockito.verify(salFlowService).addFlow(Matchers.<AddFlowInput>any());
+ Mockito.verify(salFlowService).addFlow(ArgumentMatchers.<AddFlowInput>any());
final AddFlowInput flowInput = addFlowInputCpt.getValue();
Assert.assertEquals(2, flowInput.getTableId().shortValue());
Assert.assertEquals(emptyMatch, flowInput.getMatch());
final Future<RpcResult<UpdateFlowOutput>> updateResult = flowForwarder.update(flowPath, flow,
flowUpdated, flowCapableNodePath);
- Mockito.verify(salFlowService).updateFlow(Matchers.<UpdateFlowInput>any());
+ Mockito.verify(salFlowService).updateFlow(ArgumentMatchers.<UpdateFlowInput>any());
final UpdateFlowInput updateFlowInput = updateFlowInputCpt.getValue();
final OriginalFlow flowOrigInput = updateFlowInput.getOriginalFlow();
final UpdatedFlow flowInput = updateFlowInput.getUpdatedFlow();
final Future<RpcResult<RemoveFlowOutput>> removeResult = flowForwarder.remove(flowPath,
removeFlow, flowCapableNodePath);
- Mockito.verify(salFlowService).removeFlow(Matchers.<RemoveFlowInput>any());
+ Mockito.verify(salFlowService).removeFlow(ArgumentMatchers.<RemoveFlowInput>any());
final RemoveFlowInput flowInput = removeFlowInputCpt.getValue();
Assert.assertEquals(2, flowInput.getTableId().shortValue());
Assert.assertEquals(emptyMatch, flowInput.getMatch());
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final Future<RpcResult<RemoveGroupOutput>> addResult =
groupForwarder.remove(groupPath, group, flowCapableNodePath);
- Mockito.verify(salGroupService).removeGroup(Matchers.<RemoveGroupInput>any());
+ Mockito.verify(salGroupService).removeGroup(ArgumentMatchers.<RemoveGroupInput>any());
Assert.assertTrue(addResult.isDone());
final RpcResult<RemoveGroupOutput> result = addResult.get(2, TimeUnit.SECONDS);
final Future<RpcResult<UpdateGroupOutput>> addResult =
groupForwarder.update(groupPath, groupOriginal, groupUpdate, flowCapableNodePath);
- Mockito.verify(salGroupService).updateGroup(Matchers.<UpdateGroupInput>any());
+ Mockito.verify(salGroupService).updateGroup(ArgumentMatchers.<UpdateGroupInput>any());
Assert.assertTrue(addResult.isDone());
final RpcResult<UpdateGroupOutput> result = addResult.get(2, TimeUnit.SECONDS);
final Future<RpcResult<AddGroupOutput>> addResult = groupForwarder.add(groupPath, group, flowCapableNodePath);
- Mockito.verify(salGroupService).addGroup(Matchers.<AddGroupInput>any());
+ Mockito.verify(salGroupService).addGroup(ArgumentMatchers.<AddGroupInput>any());
Assert.assertTrue(addResult.isDone());
final RpcResult<AddGroupOutput> result = addResult.get(2, TimeUnit.SECONDS);
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final Future<RpcResult<RemoveMeterOutput>> removeResult =
meterForwarder.remove(meterPath, removeMeter, flowCapableNodePath);
- Mockito.verify(salMeterService).removeMeter(Matchers.<RemoveMeterInput>any());
+ Mockito.verify(salMeterService).removeMeter(ArgumentMatchers.<RemoveMeterInput>any());
Assert.assertTrue(removeResult.isDone());
final RpcResult<RemoveMeterOutput> meterResult = removeResult.get(2, TimeUnit.SECONDS);
final Future<RpcResult<UpdateMeterOutput>> updateResult =
meterForwarder.update(meterPath, meterOriginal, meterUpdate,
flowCapableNodePath);
- Mockito.verify(salMeterService).updateMeter(Matchers.<UpdateMeterInput>any());
+ Mockito.verify(salMeterService).updateMeter(ArgumentMatchers.<UpdateMeterInput>any());
Assert.assertTrue(updateResult.isDone());
final RpcResult<UpdateMeterOutput> meterResult = updateResult.get(2, TimeUnit.SECONDS);
);
final Future<RpcResult<AddMeterOutput>> addResult = meterForwarder.add(meterPath, meter, flowCapableNodePath);
- Mockito.verify(salMeterService).addMeter(Matchers.<AddMeterInput>any());
+ Mockito.verify(salMeterService).addMeter(ArgumentMatchers.<AddMeterInput>any());
Assert.assertTrue(addResult.isDone());
final RpcResult<AddMeterOutput> meterResult = addResult.get(2, TimeUnit.SECONDS);
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
groupsToAddOrUpdate, metersToAddOrUpdate, flowsToAddOrUpdate,
flowsToRemove, metersToRemove, groupsToRemove);
- Mockito.when(flatBatchService.processFlatBatch(Matchers.<ProcessFlatBatchInput>any()))
+ Mockito.when(flatBatchService.processFlatBatch(ArgumentMatchers.<ProcessFlatBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new ProcessFlatBatchOutputBuilder().build()).buildFuture());
final SyncCrudCounters counters = new SyncCrudCounters();
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final ListenableFuture<RpcResult<Void>> rpcResult = syncPlanPushStrategy.executeSyncStrategy(
RpcResultBuilder.<Void>success().buildFuture(), diffInput, syncCounters);
- Mockito.verify(groupCommitter, Mockito.times(6)).add(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(groupCommitter, Mockito.times(3)).update(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.<Group>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(groupCommitter, Mockito.times(6)).remove(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(flowCommitter, Mockito.times(6)).add(Matchers.<InstanceIdentifier<Flow>>any(),
- Matchers.<Flow>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(flowCommitter, Mockito.times(3)).update(Matchers.<InstanceIdentifier<Flow>>any(),
- Matchers.<Flow>any(), Matchers.<Flow>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(flowCommitter, Mockito.times(6)).remove(Matchers.<InstanceIdentifier<Flow>>any(),
- Matchers.<Flow>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(meterCommitter, Mockito.times(3)).add(Matchers.<InstanceIdentifier<Meter>>any(),
- Matchers.<Meter>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(meterCommitter, Mockito.times(3)).update(Matchers.<InstanceIdentifier<Meter>>any(),
- Matchers.<Meter>any(), Matchers.<Meter>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(meterCommitter, Mockito.times(3)).remove(Matchers.<InstanceIdentifier<Meter>>any(),
- Matchers.<Meter>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(groupCommitter, Mockito.times(6)).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(groupCommitter, Mockito.times(3)).update(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.<Group>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(groupCommitter, Mockito.times(6)).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(flowCommitter, Mockito.times(6)).add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(flowCommitter, Mockito.times(3)).update(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.<Flow>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(flowCommitter, Mockito.times(6)).remove(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(meterCommitter, Mockito.times(3)).add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(meterCommitter, Mockito.times(3)).update(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.<Meter>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(meterCommitter, Mockito.times(3)).remove(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Assert.assertTrue(rpcResult.isDone());
Assert.assertTrue(rpcResult.get().isSuccessful());
@Before
public void setUp() throws Exception {
- Mockito.when(flowCapableTxService.sendBarrier(Matchers.<SendBarrierInput>any()))
+ Mockito.when(flowCapableTxService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
.thenReturn(RpcResultBuilder.success((SendBarrierOutput) null).buildFuture());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(groupCommitter).add(
- Matchers.<InstanceIdentifier<Group>>any(), Matchers.<Group>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Group>>any(), ArgumentMatchers.<Group>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(groupCommitter).update(
- Matchers.<InstanceIdentifier<Group>>any(), Matchers.<Group>any(), Matchers.<Group>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Group>>any(), ArgumentMatchers.<Group>any(),
+ ArgumentMatchers.<Group>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(groupCommitter).remove(
- Matchers.<InstanceIdentifier<Group>>any(), Matchers.<Group>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Group>>any(), ArgumentMatchers.<Group>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(flowCommitter).add(
- Matchers.<InstanceIdentifier<Flow>>any(), Matchers.<Flow>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Flow>>any(), ArgumentMatchers.<Flow>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(flowCommitter).update(
- Matchers.<InstanceIdentifier<Flow>>any(), Matchers.<Flow>any(), Matchers.<Flow>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Flow>>any(), ArgumentMatchers.<Flow>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(flowCommitter).remove(
- Matchers.<InstanceIdentifier<Flow>>any(), Matchers.<Flow>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Flow>>any(), ArgumentMatchers.<Flow>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(meterCommitter).add(
- Matchers.<InstanceIdentifier<Meter>>any(), Matchers.<Meter>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Meter>>any(), ArgumentMatchers.<Meter>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(meterCommitter).update(
- Matchers.<InstanceIdentifier<Meter>>any(), Matchers.<Meter>any(), Matchers.<Meter>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Meter>>any(), ArgumentMatchers.<Meter>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(meterCommitter).remove(
- Matchers.<InstanceIdentifier<Meter>>any(), Matchers.<Meter>any(),
- Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<Meter>>any(), ArgumentMatchers.<Meter>any(),
+ ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(tableCommitter).update(
- Matchers.<InstanceIdentifier<TableFeatures>>any(), Matchers.<TableFeatures>any(),
- Matchers.<TableFeatures>any(), Matchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.<InstanceIdentifier<TableFeatures>>any(), ArgumentMatchers.<TableFeatures>any(),
+ ArgumentMatchers.<TableFeatures>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
syncPlanPushStrategy = new SyncPlanPushStrategyIncrementalImpl()
.setMeterForwarder(meterCommitter)
@Test
public void testAddMissingFlows() throws Exception {
- Mockito.when(flowCommitter.add(Matchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(flowCommitter.add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
final ItemSyncBox<Flow> flowBox = new ItemSyncBox<>();
Assert.assertEquals("f4", flowCaptorAllValues.get(1).getId().getValue());
final InOrder inOrderFlow = Mockito.inOrder(flowCapableTxService, flowCommitter);
- inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(Matchers.<InstanceIdentifier<Flow>>any(),
- Matchers.<Flow>any(), Matchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderFlow.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
inOrderFlow.verifyNoMoreInteractions();
@Test
public void testRemoveRedundantFlows() throws Exception {
- Mockito.when(flowCommitter.remove(Matchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(flowCommitter.remove(ArgumentMatchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new RemoveFlowOutputBuilder().build()).buildFuture());
final ItemSyncBox<Flow> flowBox = new ItemSyncBox<>();
Assert.assertEquals("f4", flowCaptorAllValues.get(1).getId().getValue());
final InOrder inOrderFlow = Mockito.inOrder(flowCapableTxService, flowCommitter);
- inOrderFlow.verify(flowCommitter, Mockito.times(2)).remove(Matchers.<InstanceIdentifier<Flow>>any(),
- Matchers.<Flow>any(), Matchers.eq(NODE_IDENT));
- inOrderFlow.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderFlow.verify(flowCommitter, Mockito.times(2)).remove(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
inOrderFlow.verifyNoMoreInteractions();
}
@Test
public void testAddMissingFlows_withUpdate() throws Exception {
- Mockito.when(flowCommitter.add(Matchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(flowCommitter.add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
- Mockito.when(flowCommitter.update(Matchers.<InstanceIdentifier<Flow>>any(),
+ Mockito.when(flowCommitter.update(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
flowUpdateCaptor.capture(), flowUpdateCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateFlowOutputBuilder().build()).buildFuture());
final ItemSyncBox<Flow> flowBox = new ItemSyncBox<>();
final InOrder inOrderFlow = Mockito.inOrder(flowCapableTxService, flowCommitter);
// add f3, f4
- inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(Matchers.<InstanceIdentifier<Flow>>any(),
- Matchers.<Flow>any(), Matchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
// update f1
- inOrderFlow.verify(flowCommitter).update(Matchers.<InstanceIdentifier<Flow>>any(),
- Matchers.<Flow>any(), Matchers.<Flow>any(), Matchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCommitter).update(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ ArgumentMatchers.<Flow>any(), ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderFlow.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
@Test
public void testAddMissingMeters() throws Exception {
- Mockito.when(meterCommitter.add(Matchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(meterCommitter.add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddMeterOutputBuilder().build()).buildFuture());
final ItemSyncBox<Meter> meterSyncBox = new ItemSyncBox<>();
Assert.assertEquals(4L, metercaptorAllValues.get(1).getMeterId().getValue().longValue());
final InOrder inOrderMeter = Mockito.inOrder(flowCapableTxService, meterCommitter);
- inOrderMeter.verify(meterCommitter, Mockito.times(2)).add(Matchers.<InstanceIdentifier<Meter>>any(),
- Matchers.<Meter>any(), Matchers.eq(NODE_IDENT));
+ inOrderMeter.verify(meterCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderMeter.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
inOrderMeter.verifyNoMoreInteractions();
@Test
public void testAddMissingMeters_withUpdate() throws Exception {
- Mockito.when(meterCommitter.add(Matchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(meterCommitter.add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddMeterOutputBuilder().build()).buildFuture());
- Mockito.when(meterCommitter.update(Matchers.<InstanceIdentifier<Meter>>any(),
- meterUpdateCaptor.capture(), meterUpdateCaptor.capture(), Matchers.same(NODE_IDENT)))
+ Mockito.when(meterCommitter.update(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ meterUpdateCaptor.capture(), meterUpdateCaptor.capture(), ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateMeterOutputBuilder().build()).buildFuture());
final ItemSyncBox<Meter> meterSyncBox = new ItemSyncBox<>();
Assert.assertEquals(1L, meterUpdateCaptorAllValues.get(1).getMeterId().getValue().longValue());
final InOrder inOrderMeters = Mockito.inOrder(flowCapableTxService, meterCommitter);
- inOrderMeters.verify(meterCommitter, Mockito.times(2)).add(Matchers.<InstanceIdentifier<Meter>>any(),
- Matchers.<Meter>any(), Matchers.eq(NODE_IDENT));
- inOrderMeters.verify(meterCommitter).update(Matchers.<InstanceIdentifier<Meter>>any(),
- Matchers.<Meter>any(), Matchers.<Meter>any(), Matchers.eq(NODE_IDENT));
+ inOrderMeters.verify(meterCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderMeters.verify(meterCommitter).update(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderMeters.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
@Test
public void testRemoveRedundantMeters() throws Exception {
- Mockito.when(meterCommitter.remove(Matchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(meterCommitter.remove(ArgumentMatchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new RemoveMeterOutputBuilder().build()).buildFuture());
final ItemSyncBox<Meter> meterSyncBox = new ItemSyncBox<>();
Assert.assertEquals(4L, metercaptorAllValues.get(1).getMeterId().getValue().longValue());
final InOrder inOrderMeter = Mockito.inOrder(flowCapableTxService, meterCommitter);
- inOrderMeter.verify(meterCommitter, Mockito.times(2)).remove(Matchers.<InstanceIdentifier<Meter>>any(),
- Matchers.<Meter>any(), Matchers.eq(NODE_IDENT));
+ inOrderMeter.verify(meterCommitter, Mockito.times(2)).remove(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderMeter.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
inOrderMeter.verifyNoMoreInteractions();
@Test
public void testAddMissingGroups() throws Exception {
- Mockito.when(groupCommitter.add(Matchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(groupCommitter.add(ArgumentMatchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture());
ItemSyncBox<Group> groupBox1 = new ItemSyncBox<>();
final InOrder inOrderGroups = Mockito.inOrder(flowCapableTxService, groupCommitter);
// add 2
- inOrderGroups.verify(groupCommitter).add(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
// add 3, 4
- inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
// add 5
- inOrderGroups.verify(groupCommitter).add(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
inOrderGroups.verifyNoMoreInteractions();
}
@Test
public void testAddMissingGroups_withUpdate() throws Exception {
- Mockito.when(groupCommitter.add(Matchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(groupCommitter.add(ArgumentMatchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture());
- Mockito.when(groupCommitter.update(Matchers.<InstanceIdentifier<Group>>any(),
+ Mockito.when(groupCommitter.update(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
groupUpdateCaptor.capture(), groupUpdateCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateGroupOutputBuilder().build()).buildFuture());
ItemSyncBox<Group> groupBox1 = new ItemSyncBox<>();
final InOrder inOrderGroups = Mockito.inOrder(flowCapableTxService, groupCommitter);
// add 2, update 1
- inOrderGroups.verify(groupCommitter).add(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroups.verify(groupCommitter).update(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(groupCommitter).update(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
// add 3, 4
- inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
// add 5
- inOrderGroups.verify(groupCommitter).add(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
inOrderGroups.verifyNoMoreInteractions();
}
@Test
public void testRemoveRedundantGroups() throws Exception {
- Mockito.when(groupCommitter.remove(Matchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.when(groupCommitter.remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new RemoveGroupOutputBuilder().build()).buildFuture());
ItemSyncBox<Group> groupBox1 = new ItemSyncBox<>();
final InOrder inOrderGroup = Mockito.inOrder(flowCapableTxService, groupCommitter);
// remove 5
- inOrderGroup.verify(groupCommitter).remove(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroup.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroup.verify(groupCommitter).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
// remove 3, 4
- inOrderGroup.verify(groupCommitter, Mockito.times(2)).remove(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroup.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroup.verify(groupCommitter, Mockito.times(2)).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
// remove 2
- inOrderGroup.verify(groupCommitter).remove(Matchers.<InstanceIdentifier<Group>>any(),
- Matchers.<Group>any(), Matchers.eq(NODE_IDENT));
- inOrderGroup.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrderGroup.verify(groupCommitter).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
inOrderGroup.verifyNoMoreInteractions();
}
@Test
public void testUpdateTableFeatures() throws Exception {
- Mockito.when(tableCommitter.update(Matchers.<InstanceIdentifier<TableFeatures>>any(),
- Matchers.isNull(TableFeatures.class), tableFeaturesCaptor.capture(),
- Matchers.same(NODE_IDENT)))
+ Mockito.lenient().when(tableCommitter.update(ArgumentMatchers.<InstanceIdentifier<TableFeatures>>any(),
+ ArgumentMatchers.isNull(TableFeatures.class), tableFeaturesCaptor.capture(),
+ ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateTableOutputBuilder().build()).buildFuture());
final FlowCapableNode operational = new FlowCapableNodeBuilder()
// Assert.assertEquals("test table features", groupCaptorAllValues.get(0).getName());
// Assert.assertEquals(1, groupCaptorAllValues.get(0).getTableId().intValue());
- Mockito.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
+ Mockito.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
}
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final Future<RpcResult<UpdateTableOutput>> updateResult = tableForwarder.update(
tableFeaturesPath, tableFeatures, tableFeaturesUpdate, flowCapableNodePath);
- Mockito.verify(salTableService).updateTable(Matchers.<UpdateTableInput>any());
+ Mockito.verify(salTableService).updateTable(ArgumentMatchers.<UpdateTableInput>any());
Assert.assertTrue(updateResult.isDone());
final RpcResult<UpdateTableOutput> updateTableResult = updateResult.get(2, TimeUnit.SECONDS);
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.when(flowCapableService.sendBarrier(barrierInputCaptor.capture()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
- Mockito.verify(flowCapableService, Mockito.never()).sendBarrier(Matchers.<SendBarrierInput>any());
+ Mockito.verify(flowCapableService, Mockito.never()).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
Assert.assertFalse(vehicle.isDone());
testRabbit.set(RpcResultBuilder.<Void>success().build());
- Mockito.verify(flowCapableService).sendBarrier(Matchers.<SendBarrierInput>any());
+ Mockito.verify(flowCapableService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
Assert.assertTrue(vehicle.isDone());
Assert.assertTrue(vehicle.get().isSuccessful());
}
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInputBuilder;
LOG.debug("Sending LLDP frames to total {} ports", getOwnedPorts());
nodeConnectorMap.keySet().forEach(ncIID -> {
NodeConnectorId nodeConnectorId = InstanceIdentifier.keyOf(ncIID).getId();
- NodeId nodeId = ncIID.firstKeyOf(Node.class, NodeKey.class).getId();
+ NodeId nodeId = ncIID.firstKeyOf(Node.class).getId();
if (deviceOwnershipService.isEntityOwned(nodeId.getValue())) {
LOG.debug("Node is owned by this controller, sending LLDP packet through port {}",
nodeConnectorId.getValue());
private int getOwnedPorts() {
AtomicInteger ownedPorts = new AtomicInteger();
nodeConnectorMap.keySet().forEach(ncIID -> {
- NodeId nodeId = ncIID.firstKeyOf(Node.class, NodeKey.class).getId();
+ NodeId nodeId = ncIID.firstKeyOf(Node.class).getId();
if (deviceOwnershipService.isEntityOwned(nodeId.getValue())) {
ownedPorts.incrementAndGet();
}
package org.opendaylight.openflowplugin.applications.lldpspeaker;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyLong;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
* @return Keyed InstanceIdentifier for Node
*/
protected static KeyedInstanceIdentifier<Node, NodeKey> getNodeII(final InstanceIdentifier<?> ii) {
- final NodeKey key = ii.firstKeyOf(Node.class, NodeKey.class);
+ final NodeKey key = ii.firstKeyOf(Node.class);
Preconditions.checkArgument(key != null);
return InstanceIdentifier.create(Nodes.class).child(Node.class, key);
}
* @return extracted {@link NodeId}
*/
public static NodeId getNodeId(InstanceIdentifier<?> path) {
- final NodeKey nodeKey = Preconditions.checkNotNull(path.firstKeyOf(Node.class, NodeKey.class));
+ final NodeKey nodeKey = Preconditions.checkNotNull(path.firstKeyOf(Node.class));
return nodeKey.getId();
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdatedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
final NodeConnectorUpdatedBuilder notifBuilder = new NodeConnectorUpdatedBuilder();
final FlowCapableNodeConnectorUpdatedBuilder connNotifBuilder = new FlowCapableNodeConnectorUpdatedBuilder(
flowCapableNodeConnector);
- notifBuilder.setId(path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId());
+ notifBuilder.setId(path.firstKeyOf(NodeConnector.class).getId());
notifBuilder.setNodeConnectorRef(new NodeConnectorRef(path));
notifBuilder.addAugmentation(FlowCapableNodeConnectorUpdated.class, connNotifBuilder.build());
return notifBuilder.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdatedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
Preconditions.checkArgument(ii != null);
final FlowCapableNodeUpdatedBuilder flowNodeNotifBuilder = new FlowCapableNodeUpdatedBuilder(flowCapableNode);
final NodeUpdatedBuilder notifBuilder = new NodeUpdatedBuilder();
- notifBuilder.setId(ii.firstKeyOf(Node.class, NodeKey.class).getId());
+ notifBuilder.setId(ii.firstKeyOf(Node.class).getId());
notifBuilder.setNodeRef(new NodeRef(getNodeII(ii)));
notifBuilder.addAugmentation(FlowCapableNodeUpdated.class, flowNodeNotifBuilder.build());
return notifBuilder.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupUpdatedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
public GroupRemoved deleteNotification(final InstanceIdentifier<Group> path) {
Preconditions.checkArgument(path != null);
final GroupRemovedBuilder builder = new GroupRemovedBuilder();
- builder.setGroupId(path.firstKeyOf(Group.class, GroupKey.class).getGroupId());
+ builder.setGroupId(path.firstKeyOf(Group.class).getGroupId());
builder.setGroupRef(new GroupRef(path));
builder.setNode(createNodeRef(path));
return builder.build();
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterAdded;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterAddedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved;
public MeterRemoved deleteNotification(final InstanceIdentifier<Meter> path) {
Preconditions.checkArgument(path != null);
final MeterRemovedBuilder builder = new MeterRemovedBuilder();
- builder.setMeterId(path.firstKeyOf(Meter.class, MeterKey.class).getMeterId());
+ builder.setMeterId(path.firstKeyOf(Meter.class).getMeterId());
builder.setMeterRef(new MeterRef(path));
builder.setNode(createNodeRef(path));
return builder.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate;
Preconditions.checkArgument(path != null);
final FlowAndStatisticsMapListBuilder fsmlBuilder = new FlowAndStatisticsMapListBuilder(flowStatistics);
- fsmlBuilder.setFlowId(new FlowId(path.firstKeyOf(Flow.class, FlowKey.class).getId().getValue()));
+ fsmlBuilder.setFlowId(new FlowId(path.firstKeyOf(Flow.class).getId().getValue()));
final FlowsStatisticsUpdateBuilder builder = new FlowsStatisticsUpdateBuilder();
builder.setId(getNodeId(path));
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsData;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdateBuilder;
final FlowTableAndStatisticsMapBuilder ftsmBuilder = new FlowTableAndStatisticsMapBuilder(flowTableStatistics);
ftsmBuilder.withKey(new FlowTableAndStatisticsMapKey(
- new TableId(path.firstKeyOf(Table.class, TableKey.class).getId())));
+ new TableId(path.firstKeyOf(Table.class).getId())));
final FlowTableStatisticsUpdateBuilder builder = new FlowTableStatisticsUpdateBuilder();
builder.setId(getNodeId(path));
Preconditions.checkArgument(path != null);
final NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
- final NodeConnectorKey ncKey = path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
+ final NodeConnectorKey ncKey = path.firstKeyOf(NodeConnector.class);
ncBuilder.setId(ncKey.getId());
ncBuilder.withKey(ncKey);
Preconditions.checkArgument(path != null);
final NodeConnectorBuilder connBuilder = new NodeConnectorBuilder();
- final NodeConnectorKey key = path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
+ final NodeConnectorKey key = path.firstKeyOf(NodeConnector.class);
connBuilder.setId(key.getId());
connBuilder.withKey(key);
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
assertNotNull(notification);
assertEquals(FLOW_CODE_CONNECTOR_ID, notification.getId().getValue());
assertEquals(FLOW_CODE_CONNECTOR_ID, notification.getNodeConnectorRef().getValue()
- .firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue());
+ .firstKeyOf(NodeConnector.class).getId().getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNodeConnectorRef().getValue().firstKeyOf(Node.class, NodeKey.class).getId()
+ notification.getNodeConnectorRef().getValue().firstKeyOf(Node.class).getId()
.getValue());
}
Collection<DataTreeModification<FlowCapableNodeConnector>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(NodeConnectorUpdated.class));
+ verify(notifProviderService, times(1)).publish(any(NodeConnectorUpdated.class));
}
@Test(expected = IllegalArgumentException.class)
.deleteNotification(createTestFlowCapableConnectorNodePath());
assertNotNull(notification);
assertEquals(FLOW_CODE_CONNECTOR_ID, notification.getNodeConnectorRef().getValue()
- .firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue());
+ .firstKeyOf(NodeConnector.class).getId().getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNodeConnectorRef().getValue().firstKeyOf(Node.class, NodeKey.class).getId()
+ notification.getNodeConnectorRef().getValue().firstKeyOf(Node.class).getId()
.getValue());
}
Collection<DataTreeModification<FlowCapableNodeConnector>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(NodeConnectorRemoved.class));
+ verify(notifProviderService, times(1)).publish(any(NodeConnectorRemoved.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
assertNotNull(notification);
assertEquals(FLOW_NODE_ID, notification.getId().getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNodeRef().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNodeRef().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<FlowCapableNode>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(NodeUpdated.class));
+ verify(notifProviderService, times(1)).publish(any(NodeUpdated.class));
}
@Test(expected = IllegalArgumentException.class)
final NodeRemoved notification = notifSupplierImpl.deleteNotification(createTestFlowCapableNodePath());
assertNotNull(notification);
assertEquals(FLOW_NODE_ID,
- notification.getNodeRef().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNodeRef().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<FlowCapableNode>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(NodeRemoved.class));
+ verify(notifProviderService, times(1)).publish(any(NodeRemoved.class));
}
@Test(expected = IllegalArgumentException.class)
package org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
public static void verifyDataTreeChangeListenerRegistration(DataBroker dataBroker) {
Mockito.verify(dataBroker).registerDataTreeChangeListener(
- Matchers.<DataTreeIdentifier>any(),
- Matchers.<DataTreeChangeListener>any());
+ ArgumentMatchers.<DataTreeIdentifier>any(),
+ ArgumentMatchers.<DataTreeChangeListener>any());
}
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
final FlowAdded notification = notifSupplierImpl.createNotification(createTestFlow(), createTestFlowPath());
assertNotNull(notification);
assertEquals(FLOW_ID,
- notification.getFlowRef().getValue().firstKeyOf(Flow.class, FlowKey.class).getId().getValue());
+ notification.getFlowRef().getValue().firstKeyOf(Flow.class).getId().getValue());
assertEquals(FLOW_TABLE_ID,
- notification.getFlowRef().getValue().firstKeyOf(Table.class, TableKey.class).getId());
+ notification.getFlowRef().getValue().firstKeyOf(Table.class).getId());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Flow>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(FlowAdded.class));
+ verify(notifProviderService, times(1)).publish(any(FlowAdded.class));
}
@Test(expected = IllegalArgumentException.class)
final FlowUpdated notification = notifSupplierImpl.updateNotification(createTestFlow(), createTestFlowPath());
assertNotNull(notification);
assertEquals(FLOW_ID,
- notification.getFlowRef().getValue().firstKeyOf(Flow.class, FlowKey.class).getId().getValue());
+ notification.getFlowRef().getValue().firstKeyOf(Flow.class).getId().getValue());
assertEquals(FLOW_TABLE_ID,
- notification.getFlowRef().getValue().firstKeyOf(Table.class, TableKey.class).getId());
+ notification.getFlowRef().getValue().firstKeyOf(Table.class).getId());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Flow>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(FlowUpdated.class));
+ verify(notifProviderService, times(1)).publish(any(FlowUpdated.class));
}
@Test(expected = IllegalArgumentException.class)
final FlowRemoved notification = notifSupplierImpl.deleteNotification(createTestFlowPath());
assertNotNull(notification);
assertEquals(FLOW_ID,
- notification.getFlowRef().getValue().firstKeyOf(Flow.class, FlowKey.class).getId().getValue());
+ notification.getFlowRef().getValue().firstKeyOf(Flow.class).getId().getValue());
assertEquals(FLOW_TABLE_ID,
- notification.getFlowRef().getValue().firstKeyOf(Table.class, TableKey.class).getId());
+ notification.getFlowRef().getValue().firstKeyOf(Table.class).getId());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Flow>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(FlowRemoved.class));
+ verify(notifProviderService, times(1)).publish(any(FlowRemoved.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
assertNotNull(notification);
assertEquals(GROUP_ID, notification.getGroupId().getValue());
assertEquals(GROUP_ID,
- notification.getGroupRef().getValue().firstKeyOf(Group.class, GroupKey.class).getGroupId()
+ notification.getGroupRef().getValue().firstKeyOf(Group.class).getGroupId()
.getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Group>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(GroupAdded.class));
+ verify(notifProviderService, times(1)).publish(any(GroupAdded.class));
}
@Test(expected = IllegalArgumentException.class)
assertNotNull(notification);
assertEquals(GROUP_ID, notification.getGroupId().getValue());
assertEquals(GROUP_ID,
- notification.getGroupRef().getValue().firstKeyOf(Group.class, GroupKey.class).getGroupId()
+ notification.getGroupRef().getValue().firstKeyOf(Group.class).getGroupId()
.getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Group>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(GroupUpdated.class));
+ verify(notifProviderService, times(1)).publish(any(GroupUpdated.class));
}
@Test(expected = IllegalArgumentException.class)
assertNotNull(notification);
assertEquals(GROUP_ID, notification.getGroupId().getValue());
assertEquals(GROUP_ID,
- notification.getGroupRef().getValue().firstKeyOf(Group.class, GroupKey.class).getGroupId()
+ notification.getGroupRef().getValue().firstKeyOf(Group.class).getGroupId()
.getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Group>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(GroupRemoved.class));
+ verify(notifProviderService, times(1)).publish(any(GroupRemoved.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
assertNotNull(notification);
assertEquals(METER_ID, notification.getMeterId().getValue());
assertEquals(METER_ID,
- notification.getMeterRef().getValue().firstKeyOf(Meter.class, MeterKey.class).getMeterId()
+ notification.getMeterRef().getValue().firstKeyOf(Meter.class).getMeterId()
.getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Meter>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(MeterAdded.class));
+ verify(notifProviderService, times(1)).publish(any(MeterAdded.class));
}
@Test(expected = IllegalArgumentException.class)
assertNotNull(notification);
assertEquals(METER_ID, notification.getMeterId().getValue());
assertEquals(METER_ID,
- notification.getMeterRef().getValue().firstKeyOf(Meter.class, MeterKey.class).getMeterId()
+ notification.getMeterRef().getValue().firstKeyOf(Meter.class).getMeterId()
.getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Meter>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(MeterUpdated.class));
+ verify(notifProviderService, times(1)).publish(any(MeterUpdated.class));
}
@Test(expected = IllegalArgumentException.class)
assertNotNull(notification);
assertEquals(METER_ID, notification.getMeterId().getValue());
assertEquals(METER_ID,
- notification.getMeterRef().getValue().firstKeyOf(Meter.class, MeterKey.class).getMeterId()
+ notification.getMeterRef().getValue().firstKeyOf(Meter.class).getMeterId()
.getValue());
assertEquals(FLOW_NODE_ID,
- notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
+ notification.getNode().getValue().firstKeyOf(Node.class).getId().getValue());
}
@Test
Collection<DataTreeModification<Meter>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(MeterRemoved.class));
+ verify(notifProviderService, times(1)).publish(any(MeterRemoved.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
Collection<DataTreeModification<FlowStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(FlowsStatisticsUpdate.class));
+ verify(notifProviderService, times(1)).publish(any(FlowsStatisticsUpdate.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
Collection<DataTreeModification<FlowTableStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(FlowTableStatisticsUpdate.class));
+ verify(notifProviderService, times(1)).publish(any(FlowTableStatisticsUpdate.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
Collection<DataTreeModification<GroupStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(GroupStatisticsUpdated.class));
+ verify(notifProviderService, times(1)).publish(any(GroupStatisticsUpdated.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
Collection<DataTreeModification<MeterStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(MeterStatisticsUpdated.class));
+ verify(notifProviderService, times(1)).publish(any(MeterStatisticsUpdated.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
Collection<DataTreeModification<FlowCapableNodeConnectorStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(NodeConnectorStatisticsUpdate.class));
+ verify(notifProviderService, times(1)).publish(any(NodeConnectorStatisticsUpdate.class));
}
@Test(expected = IllegalArgumentException.class)
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
Collection<DataTreeModification<FlowCapableNodeConnectorQueueStatisticsData>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(QueueStatisticsUpdate.class));
+ verify(notifProviderService, times(1)).publish(any(QueueStatisticsUpdate.class));
}
@Test(expected = IllegalArgumentException.class)
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.NodeConfigService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigOutput;
for (DataTreeModification<FlowCapableNode> modification : modifications) {
if (modification.getRootNode().getModificationType() == ModificationType.WRITE) {
String nodeId = modification.getRootPath().getRootIdentifier()
- .firstKeyOf(Node.class, NodeKey.class).getId().getValue();
+ .firstKeyOf(Node.class).getId().getValue();
if (deviceOwnershipService.isEntityOwned(nodeId)) {
SetConfigInputBuilder setConfigInputBuilder = new SetConfigInputBuilder();
setConfigInputBuilder.setFlag(SwitchConfigFlag.FRAGNORMAL.toString());
package org.opendaylight.openflowplugin.openflow.ofswitch.config;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
private ListenableFuture<RpcResult<ReconcileOutput>> buildErrorResponse(String msg) {
SettableFuture<RpcResult<ReconcileOutput>> result = SettableFuture.create();
- LOG.error(msg);
+ LOG.error("Error {}", msg);
RpcError error = RpcResultBuilder.newError(RpcError.ErrorType.PROTOCOL, "reconcile", msg);
result.set(RpcResultBuilder.<ReconcileOutput>failed().withRpcError(error).build());
return result;
if (flowCapableNode != null) {
name = node.<FlowCapableNode>augmentation(FlowCapableNode.class).getDescription();
} else {
- LOG.error("Error while converting OFNode:{} to FlowCapableNode: {}", node.getId());
+ LOG.error("Error while converting OFNode:{} to FlowCapableNode", node.getId());
return null;
}
nodeConnectors = node.getNodeConnector();
FlowCapableNodeConnector flowCapableNodeConnector =
nodeConnector.augmentation(FlowCapableNodeConnector.class);
if (flowCapableNodeConnector == null) {
- LOG.error("Error for OFNode:{} while reading nodeConnectors {}", node.getId());
+ LOG.error("Error for OFNode:{} while reading nodeConnectors", node.getId());
return null;
} else {
String portName = flowCapableNodeConnector.getName();
}
ofNode = new OFNode(nodeId, name, portList);
} else {
- LOG.error("OFNode with nodeId {} not present Inventory DS: {}", nodeId);
+ LOG.error("OFNode with nodeId {} not present Inventory DS", nodeId);
return null;
}
} catch (ExecutionException | InterruptedException e) {
- LOG.error("Error reading node {} from Inventory DS: {}", nodeId, e);
+ LOG.error("Error reading node {} from Inventory DS", nodeId, e);
}
return ofNode;
}
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
for (DataTreeModification<FlowCapableNode> modification : modifications) {
if (modification.getRootNode().getModificationType() == ModificationType.WRITE) {
String nodeId = modification.getRootPath().getRootIdentifier()
- .firstKeyOf(Node.class, NodeKey.class).getId().getValue();
+ .firstKeyOf(Node.class).getId().getValue();
if (deviceOwnershipService.isEntityOwned(nodeId)) {
AddFlowInputBuilder addFlowInput = new AddFlowInputBuilder(createFlow());
addFlowInput.setNode(new NodeRef(modification.getRootPath()
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
*/
package org.opendaylight.openflowplugin.applications.topology.lldp.utils;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.hash.HashCode;
import com.google.common.hash.HashFunction;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Objects;
+import java.util.Optional;
+
import org.apache.commons.lang3.ArrayUtils;
import org.opendaylight.mdsal.eos.binding.api.Entity;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
-import com.google.common.base.Optional;
+import java.util.Optional;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
lldpLinkAger = new LLDPLinkAger(getConfig(), notificationService, getConfigurationService(), eos);
Mockito.when(link.getDestination()).thenReturn(new NodeConnectorRef(
InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId("openflow:1")))));
- Mockito.when(eos.getOwnershipState(Mockito.any(Entity.class))).thenReturn(
+ Mockito.when(eos.getOwnershipState(any(Entity.class))).thenReturn(
Optional.of(EntityOwnershipState.IS_OWNER));
}
public void testLLDPAgingTask() throws InterruptedException {
lldpLinkAger.put(link);
Thread.sleep(SLEEP);
- verify(notificationService).publish(Matchers.any(LinkRemoved.class));
+ verify(notificationService).publish(any(LinkRemoved.class));
}
private TopologyLldpDiscoveryConfig getConfig() {
final ConfigurationService configurationService = Mockito.mock(ConfigurationService.class);
final TopologyLldpDiscoveryConfig config = getConfig();
- Mockito.when(configurationService.registerListener(Mockito.any())).thenReturn(() -> {
+ Mockito.when(configurationService.registerListener(any())).thenReturn(() -> {
});
- Mockito.when(configurationService.getProperty(Mockito.eq("topology-lldp-interval"), Mockito.any()))
+ Mockito.lenient().when(configurationService.getProperty(Mockito.eq("topology-lldp-interval"), any()))
.thenReturn(config.getTopologyLldpInterval());
- Mockito.when(configurationService.getProperty(Mockito.eq("topology-lldp-expiration-interval"), Mockito.any()))
+ Mockito.lenient().when(configurationService.getProperty(Mockito.eq("topology-lldp-expiration-interval"), any()))
.thenReturn(config.getTopologyLldpExpirationInterval());
return configurationService;
NodeConnectorRef nodeConnectorRef = LLDPDiscoveryUtils.lldpToNodeConnectorRef(packetLLDP, false);
- NodeKey nodeKey = nodeConnectorRef.getValue().firstKeyOf(Node.class, NodeKey.class);
- NodeConnectorKey nodeConnectorKey = nodeConnectorRef.getValue().firstKeyOf(NodeConnector.class,
- NodeConnectorKey.class);
+ NodeKey nodeKey = nodeConnectorRef.getValue().firstKeyOf(Node.class);
+ NodeConnectorKey nodeConnectorKey = nodeConnectorRef.getValue().firstKeyOf(NodeConnector.class);
assertEquals(nodeKey.getId().getValue(), "openflow:2");
assertEquals(nodeConnectorKey.getId().getValue(), "openflow:2:2");
}
public static NodeKey getNodeKey(final NodeRef ref) {
- return ref.getValue().firstKeyOf(Node.class, NodeKey.class);
+ return ref.getValue().firstKeyOf(Node.class);
}
public static NodeKey getNodeKey(final NodeConnectorRef ref) {
- return ref.getValue().firstKeyOf(Node.class, NodeKey.class);
+ return ref.getValue().firstKeyOf(Node.class);
}
public static NodeConnectorKey getNodeConnectorKey(final NodeConnectorRef ref) {
- return ref.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
+ return ref.getValue().firstKeyOf(NodeConnector.class);
}
public static NodeId toTopologyNodeId(
*/
package org.opendaylight.openflowplugin.applications.topology.manager;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.inOrder;
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
</parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>openflowplugin-karaf</artifactId>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<?xml version="1.0"?>
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
}
if (LearnCodecUtil.length != 0) {
- LOG.error("Learn Codec read " + Math.abs(messageLength)
- + " bytes more than needed from stream. Packet might be corrupted");
+ LOG.error("Learn Codec read {} bytes more than needed from stream. Packet might be corrupted",
+ Math.abs(messageLength));
}
nxActionLearnBuilder.setFlowMods(flowModeList);
}
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import java.util.LinkedList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Test
public void niciraExtensionsCodecRegistratorImplTest() {
- Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF10_DESERIALIZER_KEY),
- Matchers.any(ActionDeserializer.class));
- Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF13_DESERIALIZER_KEY),
- Matchers.any(ActionDeserializer.class));
+ Mockito.verify(provider).registerActionDeserializer(eq(ActionDeserializer.OF10_DESERIALIZER_KEY),
+ any(ActionDeserializer.class));
+ Mockito.verify(provider).registerActionDeserializer(eq(ActionDeserializer.OF13_DESERIALIZER_KEY),
+ any(ActionDeserializer.class));
}
@Test
public void registerActionSerializerTest() {
niciraExtensionCodecRegistrator.registerActionSerializer(actionSerializerKey, actionSerializer);
ActionSerializerKey key1 = NiciraUtil.createOfJavaKeyFrom(actionSerializerKey);
- Mockito.verify(provider).registerActionSerializer(Matchers.eq(key1), Matchers.any(OFGeneralSerializer.class));
+ Mockito.verify(provider).registerActionSerializer(eq(key1), any(OFGeneralSerializer.class));
}
@Test
niciraExtensionCodecRegistrator.registerActionSerializer(actionSerializerKey, actionSerializer);
ActionSerializerKey key1 = NiciraUtil.createOfJavaKeyFrom(actionSerializerKey);
niciraExtensionCodecRegistrator.unregisterActionSerializer(actionSerializerKey);
- Mockito.verify(provider).unregisterSerializer(Matchers.eq(key1));
+ Mockito.verify(provider).unregisterSerializer(eq(key1));
}
@Test
niciraExtensionCodecRegistrator.registerActionDeserializer(actionDeserializerKey, actionDeserializer);
assertFalse(niciraExtensionCodecRegistrator.isEmptyActionDeserializers());
Mockito.verify((DeserializerRegistryInjector) actionDeserializer)
- .injectDeserializerRegistry(Matchers.any());
+ .injectDeserializerRegistry(any());
}
@Test
*/
package org.opendaylight.openflowjava.nx;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Test
public void registerNiciraExtensionsTest() {
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7)),
- Matchers.any(RegLoadCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7)),
+ any(RegLoadCodec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class)),
- Matchers.any(RegLoadCodec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class)),
+ any(RegLoadCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 33)),
- Matchers.any(RegLoad2Codec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 33)),
+ any(RegLoad2Codec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad2.class)),
- Matchers.any(RegLoad2Codec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad2.class)),
+ any(RegLoad2Codec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6)),
- Matchers.any(RegMoveCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6)),
+ any(RegMoveCodec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class)),
- Matchers.any(RegMoveCodec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class)),
+ any(RegMoveCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15)),
- Matchers.any(OutputRegCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15)),
+ any(OutputRegCodec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class)),
- Matchers.any(OutputRegCodec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class)),
+ any(OutputRegCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 32)),
- Matchers.any(OutputReg2Codec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 32)),
+ any(OutputReg2Codec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg2.class)),
- Matchers.any(OutputReg2Codec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg2.class)),
+ any(OutputReg2Codec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class)),
- Matchers.any(ResubmitCodec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class)),
+ any(ResubmitCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1)),
- Matchers.any(ResubmitCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1)),
+ any(ResubmitCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14)),
- Matchers.any(ResubmitCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14)),
+ any(ResubmitCodec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class)),
- Matchers.any(MultipathCodec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class)),
+ any(MultipathCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10)),
- Matchers.any(MultipathCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10)),
+ any(MultipathCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 46)),
- Matchers.any(EncapCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 46)),
+ any(EncapCodec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionEncap.class)),
- Matchers.any(EncapCodec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionEncap.class)),
+ any(EncapCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 47)),
- Matchers.any(DecapCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 47)),
+ any(DecapCodec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecap.class)),
- Matchers.any(DecapCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class)),
- Matchers.any(Reg0Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0)),
- Matchers.any(Reg0Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class)),
- Matchers.any(Reg1Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1)),
- Matchers.any(Reg1Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class)),
- Matchers.any(Reg2Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2)),
- Matchers.any(Reg2Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class)),
- Matchers.any(Reg3Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3)),
- Matchers.any(Reg3Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class)),
- Matchers.any(Reg4Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4)),
- Matchers.any(Reg4Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class)),
- Matchers.any(Reg5Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5)),
- Matchers.any(Reg5Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class)),
- Matchers.any(Reg6Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6)),
- Matchers.any(Reg6Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class)),
- Matchers.any(Reg7Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7)),
- Matchers.any(Reg7Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class)),
- Matchers.any(TunIdCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16)),
- Matchers.any(TunIdCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class)),
- Matchers.any(ArpOpCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15)),
- Matchers.any(ArpOpCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class)),
- Matchers.any(ArpShaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17)),
- Matchers.any(ArpShaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class)),
- Matchers.any(ArpSpaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16)),
- Matchers.any(ArpSpaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class)),
- Matchers.any(ArpThaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18)),
- Matchers.any(ArpThaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class)),
- Matchers.any(ArpTpaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17)),
- Matchers.any(ArpTpaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class)),
- Matchers.any(EthDstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1)),
- Matchers.any(EthDstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class)),
- Matchers.any(EthSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2)),
- Matchers.any(EthSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecap.class)),
+ any(DecapCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class)),
+ any(Reg0Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0)),
+ any(Reg0Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class)),
+ any(Reg1Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1)),
+ any(Reg1Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class)),
+ any(Reg2Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2)),
+ any(Reg2Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class)),
+ any(Reg3Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3)),
+ any(Reg3Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class)),
+ any(Reg4Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4)),
+ any(Reg4Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class)),
+ any(Reg5Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5)),
+ any(Reg5Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class)),
+ any(Reg6Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6)),
+ any(Reg6Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class)),
+ any(Reg7Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7)),
+ any(Reg7Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class)),
+ any(TunIdCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16)),
+ any(TunIdCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class)),
+ any(ArpOpCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15)),
+ any(ArpOpCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class)),
+ any(ArpShaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17)),
+ any(ArpShaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class)),
+ any(ArpSpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16)),
+ any(ArpSpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class)),
+ any(ArpThaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18)),
+ any(ArpThaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class)),
+ any(ArpTpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17)),
+ any(ArpTpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class)),
+ any(EthDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1)),
+ any(EthDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(
+ eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class)),
+ any(EthSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2)),
+ any(EthSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class)),
- Matchers.any(EthTypeCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3)),
- Matchers.any(EthTypeCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ any(EthTypeCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3)),
+ any(EthTypeCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class)),
- Matchers.any(TunIpv4DstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32)),
- Matchers.any(TunIpv4DstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ any(TunIpv4DstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32)),
+ any(TunIpv4DstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class)),
- Matchers.any(TunIpv4SrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31)),
- Matchers.any(TunIpv4SrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class)),
- Matchers.any(TcpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9)),
- Matchers.any(TcpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class)),
- Matchers.any(TcpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10)),
- Matchers.any(TcpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class)),
- Matchers.any(UdpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11)),
- Matchers.any(UdpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class)),
- Matchers.any(UdpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12)),
- Matchers.any(UdpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ any(TunIpv4SrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31)),
+ any(TunIpv4SrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class)),
+ any(TcpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9)),
+ any(TcpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class)),
+ any(TcpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10)),
+ any(TcpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class)),
+ any(UdpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11)),
+ any(UdpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class)),
+ any(UdpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12)),
+ any(UdpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class)),
- Matchers.any(CtStateCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105)),
- Matchers.any(CtStateCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class)),
- Matchers.any(CtZoneCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106)),
- Matchers.any(CtZoneCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class)),
- Matchers.any(CtMarkCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107)),
- Matchers.any(CtMarkCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
- NxmNxCtTpSrc.class)), Matchers.any(CtTpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
- OxmMatchConstants.NXM_1_CLASS, 124)), Matchers.any(CtTpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
- NxmNxCtTpDst.class)), Matchers.any(CtTpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
- OxmMatchConstants.NXM_1_CLASS, 125)), Matchers.any(CtTpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
- .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
- NxmNxPktMark.class)), Matchers.any(PktMarkCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
- .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
- OxmMatchConstants.NXM_1_CLASS, 33)), Matchers.any(PktMarkCodec.class));
+ any(CtStateCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105)),
+ any(CtStateCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class)),
+ any(CtZoneCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106)),
+ any(CtZoneCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class)),
+ any(CtMarkCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107)),
+ any(CtMarkCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
+ NxmNxCtTpSrc.class)), any(CtTpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
+ OxmMatchConstants.NXM_1_CLASS, 124)), any(CtTpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
+ NxmNxCtTpDst.class)), any(CtTpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
+ OxmMatchConstants.NXM_1_CLASS, 125)), any(CtTpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
+ NxmNxPktMark.class)), any(PktMarkCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
+ OxmMatchConstants.NXM_1_CLASS, 33)), any(PktMarkCodec.class));
Mockito.verify(registrator).registerActionDeserializer(
- Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 48)),
- Matchers.any(DecNshTtlCodec.class));
+ eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 48)),
+ any(DecNshTtlCodec.class));
Mockito.verify(registrator).registerActionSerializer(
- Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecNshTtl.class)),
- Matchers.any(DecNshTtlCodec.class));
+ eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecNshTtl.class)),
+ any(DecNshTtlCodec.class));
// experimenters
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshFlags> nshFlagsSerializerKey = new MatchEntrySerializerKey<>(
NxmNxNshFlags.class);
nshFlagsSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nshFlagsSerializerKey),
- Matchers.any(NshFlagsCodec.class));
+ eq(nshFlagsSerializerKey),
+ any(NshFlagsCodec.class));
MatchEntryDeserializerKey nshFlagsDeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
1);
nshFlagsDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nshFlagsDeserializerKey),
- Matchers.any(NshFlagsCodec.class));
+ eq(nshFlagsDeserializerKey),
+ any(NshFlagsCodec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshMdtype> mdtypeSerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNshMdtype.class);
mdtypeSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(mdtypeSerializerKey),
- Matchers.any(NshMdtypeCodec.class));
+ eq(mdtypeSerializerKey),
+ any(NshMdtypeCodec.class));
MatchEntryDeserializerKey mdtypeDeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
2);
mdtypeDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(mdtypeDeserializerKey),
- Matchers.any(NshMdtypeCodec.class));
+ eq(mdtypeDeserializerKey),
+ any(NshMdtypeCodec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshNp> nshNpSerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNshNp.class);
nshNpSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nshNpSerializerKey),
- Matchers.any(NshNpCodec.class));
+ eq(nshNpSerializerKey),
+ any(NshNpCodec.class));
MatchEntryDeserializerKey nshNpDeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
3);
nshNpDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nshNpDeserializerKey),
- Matchers.any(NshNpCodec.class));
+ eq(nshNpDeserializerKey),
+ any(NshNpCodec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNsp> nspSerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNsp.class);
nspSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nspSerializerKey),
- Matchers.any(NspCodec.class));
+ eq(nspSerializerKey),
+ any(NspCodec.class));
MatchEntryDeserializerKey nspDeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
4);
nspDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nspDeserializerKey),
- Matchers.any(NspCodec.class));
+ eq(nspDeserializerKey),
+ any(NspCodec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNsi> nsiSerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNsi.class);
nsiSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nsiSerializerKey),
- Matchers.any(NsiCodec.class));
+ eq(nsiSerializerKey),
+ any(NsiCodec.class));
MatchEntryDeserializerKey nsiDeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
5);
nsiDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nsiDeserializerKey),
- Matchers.any(NsiCodec.class));
+ eq(nsiDeserializerKey),
+ any(NsiCodec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc1> nshc1SerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNshc1.class);
nshc1SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nshc1SerializerKey),
- Matchers.any(Nshc1Codec.class));
+ eq(nshc1SerializerKey),
+ any(Nshc1Codec.class));
MatchEntryDeserializerKey nshc1DeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
6);
nshc1DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nshc1DeserializerKey),
- Matchers.any(Nshc1Codec.class));
+ eq(nshc1DeserializerKey),
+ any(Nshc1Codec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc2> nshc2SerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNshc2.class);
nshc2SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nshc2SerializerKey),
- Matchers.any(Nshc2Codec.class));
+ eq(nshc2SerializerKey),
+ any(Nshc2Codec.class));
MatchEntryDeserializerKey nshc2DeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
7);
nshc2DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nshc2DeserializerKey),
- Matchers.any(Nshc2Codec.class));
+ eq(nshc2DeserializerKey),
+ any(Nshc2Codec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc3> nshc3SerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNshc3.class);
nshc3SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nshc3SerializerKey),
- Matchers.any(Nshc3Codec.class));
+ eq(nshc3SerializerKey),
+ any(Nshc3Codec.class));
MatchEntryDeserializerKey nshc3DeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
8);
nshc3DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nshc3DeserializerKey),
- Matchers.any(Nshc3Codec.class));
+ eq(nshc3DeserializerKey),
+ any(Nshc3Codec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc4> nshc4SerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNshc4.class);
nshc4SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nshc4SerializerKey),
- Matchers.any(Nshc4Codec.class));
+ eq(nshc4SerializerKey),
+ any(Nshc4Codec.class));
MatchEntryDeserializerKey nshc4DeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
9);
nshc4DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nshc4DeserializerKey),
- Matchers.any(Nshc4Codec.class));
+ eq(nshc4DeserializerKey),
+ any(Nshc4Codec.class));
MatchEntrySerializerKey<ExperimenterClass, NxmNxNshTtl> nshTtlSerializerKey = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID,
ExperimenterClass.class,
NxmNxNshTtl.class);
nshTtlSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntrySerializer(
- Matchers.eq(nshTtlSerializerKey),
- Matchers.any(NshTtlCodec.class));
+ eq(nshTtlSerializerKey),
+ any(NshTtlCodec.class));
MatchEntryDeserializerKey nshTtlDeserializerKey = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID,
OxmMatchConstants.EXPERIMENTER_CLASS,
10);
nshTtlDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
Mockito.verify(registrator).registerMatchEntryDeserializer(
- Matchers.eq(nshTtlDeserializerKey),
- Matchers.any(NshTtlCodec.class));
+ eq(nshTtlDeserializerKey),
+ any(NshTtlCodec.class));
}
@Test
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.when;
final MatchEntry matchEntry = new MatchEntryBuilder().build();
when(deserializerRegistry.getDeserializer(key)).thenReturn(ofDeserializer);
when(ofDeserializer.deserialize(byteBuf)).thenAnswer(invocationOnMock -> {
- invocationOnMock.getArgumentAt(0, ByteBuf.class).skipBytes(8);
+ invocationOnMock.<ByteBuf>getArgument(0).skipBytes(8);
return matchEntry;
});
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
String msg = input.getOxmMatchField()
+ " does not implement "
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg.class;
- LOG.warn(msg);
+ LOG.warn("Warning {}",msg);
throw new IllegalStateException(msg);
}
nxRegBuilder.setReg((Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Test
public void testRegisterConverters() throws Exception {
Mockito.verify(extensionConverterRegistrator, Mockito.atLeastOnce()).registerActionConvertor(
- Matchers.<TypeVersionKey<? extends Action>>any(),
- Matchers.<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
+ ArgumentMatchers.<TypeVersionKey<? extends Action>>any(),
+ ArgumentMatchers.<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
.common.action.rev150203.actions.grouping.Action>>any());
}
}
package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
-import static org.mockito.Mockito.when;
-
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@Before
public void setUp() throws Exception {
final NxCtClear nxCtClear = Mockito.mock(NxCtClear.class);
- when(actionsCase.getNxCtClear()).thenReturn(nxCtClear);
final ActionCtClear actionCtClear = Mockito.mock(ActionCtClear.class);
final NxActionCtClear nxActionCtClear = Mockito.mock(NxActionCtClear.class);
- when(actionCtClear.getNxActionCtClear()).thenReturn(nxActionCtClear);
- when(action.getActionChoice()).thenReturn(actionCtClear);
ctClearConvertor = new CtClearConvertor();
}
package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
-import static org.mockito.Mockito.when;
-
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@Before
public void setUp() throws Exception {
NxDecNshTtl nxDecNshTtl = Mockito.mock(NxDecNshTtl.class);
- when(actionsCase.getNxDecNshTtl()).thenReturn(nxDecNshTtl);
NxActionDecNshTtl nxActionDecNshTtl = Mockito.mock(NxActionDecNshTtl.class);
ActionDecNshTtl actionDecNshTtl = Mockito.mock(ActionDecNshTtl.class);
- when(actionDecNshTtl.getNxActionDecNshTtl()).thenReturn(nxActionDecNshTtl);
- when(action.getActionChoice()).thenReturn(actionDecNshTtl);
decNshTtlConvertor = new DecNshTtlConvertor();
}
when(nxRegMove.getSrc()).thenReturn(src);
when(nxRegMove.getDst()).thenReturn(dst);
when(nxRegMove.getSrc().getStart()).thenReturn(1);
- when(nxRegMove.getSrc().getEnd()).thenReturn(2);
when(nxRegMove.getDst().getStart()).thenReturn(3);
when(nxRegMove.getDst().getEnd()).thenReturn(4);
when(nxRegMove.getDst().getDstChoice()).thenReturn(new DstNxTunIdCaseBuilder().build());
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchRpcAddFlowBuilder.setNxmOfArpOp(nxmOfArpOpBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
final MatchEntry converted = arpOpConvertor.convert(extension);
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
.setNxmNxArpSha(nxmNxArpShaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
arpShaConvertor = new ArpShaConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchRpcAddFlowBuilder.setNxmOfArpSpa(nxmOfArpSpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
final MatchEntry converted = arpSpaConvertor.convert(extension);
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
.setNxmNxArpTha(nxArpThaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
arpThaConvertor = new ArpThaConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchRpcAddFlowBuilder.setNxmOfArpTpa(nxmOfArpTpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
arpTpaConvertor = new ArpTpaConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtState(nxmNxCtStateBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ctStateConvertor = new CtStateConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtZone(nxmNxCtZoneBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ctZoneConvertor = new CtZoneConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthDst(nxmOfEthDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ethDstConvertor = new EthDstConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthSrc(nxmOfEthSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ethSrcConvertor = new EthSrcConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthType(nxmOfEthTypeBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ethTypeConvertor = new EthTypeConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshFlags(nxmNxNshFlags)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshFlagsConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshMdtype(nxmNxNshMdtype)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshMdtypeConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshNp(nxmNxNshNp)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshNpConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshTtl(nxmNxNshTtl)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshTtlConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc1(nxmNxNshc1)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc1Convertor = new Nshc1Convertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc2(nxmNxNshc2)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc2Convertor = new Nshc2Convertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc3(nxmNxNshc3)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc3Convertor = new Nshc3Convertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc4(nxmNxNshc4)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc4Convertor = new Nshc4Convertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNsi(nxmNxNsi)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nsiConvertor = new NsiConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNsp(nxmNxNsp)
.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nspConvertor = new NspConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpDst(nxmOfTcpDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tcpDstConvertor = new TcpDstConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpSrc(nxmOfTcpSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tcpSrcConvertor = new TcpSrcConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Dst(nxmNxTunIpv4DstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tunIPv4DstConvertor = new TunIPv4DstConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Src(nxmNxTunIpv4SrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tunIPv4DstConvertor = new TunIPv4SrcConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunId(nxmNxTunIdBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tunIdConvertor = new TunIdConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpDst(nxmOfUdpDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
udpDstConvertor = new UdpDstConvertor();
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpSrc(nxmOfUdpSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
udpSrcConvertor = new UdpSrcConvertor();
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>openflowplugin-extension-parent</artifactId>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
package org.opendaylight.openflowplugin.extension.onf.deserializer;
+import static org.mockito.ArgumentMatchers.any;
+
import io.netty.buffer.ByteBuf;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
+ "00 00 " // type 2
+ "00 04 " // length 2
+ "00 00 00 00"); // data 2
- Mockito.when(registry.getDeserializer(Matchers.any(MessageCodeKey.class)))
+ Mockito.when(registry.getDeserializer(any(MessageCodeKey.class)))
.thenReturn(experimenterPropertyDeserializer);
((DeserializerRegistryInjector)factory).injectDeserializerRegistry(registry);
BundleControlOnf builtByFactory = factory.deserialize(buffer);
package org.opendaylight.openflowplugin.extension.onf.serializer;
+import static org.mockito.ArgumentMatchers.any;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
import java.util.ArrayList;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
if (withProperty) {
dataBuilder.setBundleProperty(new ArrayList<>(Collections.singleton(
BundleTestUtils.createExperimenterProperty(propertyExperimenterData))));
- Mockito.when(registry.getSerializer(Matchers.any()))
+ Mockito.when(registry.getSerializer(any()))
.thenReturn(caseSerializer)
.thenReturn(propertySerializer);
} else {
- Mockito.when(registry.getSerializer(Matchers.any())).thenReturn(caseSerializer);
+ Mockito.when(registry.getSerializer(any())).thenReturn(caseSerializer);
}
builder.setOnfAddMessageGroupingData(dataBuilder.build());
Assert.assertEquals("Wrong bundle ID", 1L, out.readUnsignedInt());
long padding = out.readUnsignedShort();
Assert.assertEquals("Wrong flags", 1, out.readUnsignedShort());
- Mockito.verify(caseSerializer).serialize(Mockito.any(), Mockito.any());
+ Mockito.verify(caseSerializer).serialize(any(), any());
if (withProperty) {
Mockito.verify(propertySerializer).serialize(propertyExperimenterData, out);
package org.opendaylight.openflowplugin.extension.onf.serializer;
+import static org.mockito.ArgumentMatchers.any;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
import java.util.ArrayList;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
if (withProperty) {
dataBuilder.setBundleProperty(new ArrayList<>(Collections.singleton(
BundleTestUtils.createExperimenterProperty(propertyExperimenterData))));
- Mockito.when(registry.getSerializer(Matchers.any())).thenReturn(propertySerializer);
+ Mockito.when(registry.getSerializer(any())).thenReturn(propertySerializer);
((SerializerRegistryInjector) factory).injectSerializerRegistry(registry);
}
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>org.opendaylight.odlparent</groupId>
- <artifactId>odl-guava-23</artifactId>
+ <artifactId>odl-guava</artifactId>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-openflowplugin-libraries">
<feature name="odl-openflowplugin-libraries">
- <feature version="[3.0.0,4)">odl-guava-23</feature>
+ <feature version="[4,5)">odl-guava</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>2.6.0-SNAPSHOT</version>
+ <version>3.0.1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<url>https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main</url>
<tag>HEAD</tag>
</scm>
-</project>
\ No newline at end of file
+</project>
* convert primitive data types to stream of bits.
*/
public abstract class BitBufferHelper {
- protected static final Logger LOG = LoggerFactory.getLogger(BitBufferHelper.class);
+ private static final Logger LOG = LoggerFactory.getLogger(BitBufferHelper.class);
public static final long BYTE_MASK = 0xFF;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Class that represents the LLDP frame objects.
*/
public class LLDP extends Packet {
+ private static final Logger LOG = LoggerFactory.getLogger(LLDP.class);
private static final String CHASSISID = "ChassisId";
private static final String SYSTEMNAMEID = "SystemNameID";
private static final String PORTID = "PortId";
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Class that represents the LLDPTLV objects.
*/
@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
public class LLDPTLV extends Packet {
+ private static final Logger LOG = LoggerFactory.getLogger(LLDPTLV.class);
private static final String TYPE = "Type";
private static final String LENGTH = "Length";
private static final String VALUE = "Value";
* Utility class containing the common utility functions needed for operating on networking data structures.
*/
public abstract class NetUtils {
- protected static final Logger LOG = LoggerFactory.getLogger(NetUtils.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NetUtils.class);
/**
* Constant holding the number of bits in a byte.
*/
public abstract class Packet {
- protected static final Logger LOG = LoggerFactory.getLogger(Packet.class);
+ private static final Logger LOG = LoggerFactory.getLogger(Packet.class);
// Access level granted to this packet
protected boolean writeAccess;
postSerializeCustomOperation(packetBytes);
if (LOG.isTraceEnabled()) {
- LOG.trace("{}: {}", this.getClass().getSimpleName(),
+ LOG.trace("packet {}: {}", this.getClass().getSimpleName(),
HexEncode.bytesToHexString(packetBytes));
}
<artifactId>yang-common</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>2.6.0-SNAPSHOT</version>
+ <version>3.0.1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>yang-common</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
int code = rawMessage.readUnsignedShort();
if (type != null) {
switch (type) {
- case HELLOFAILED:
- {
+ case HELLOFAILED: {
HelloFailedCode errorCode = HelloFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case BADREQUEST:
- {
+ case BADREQUEST: {
BadRequestCode errorCode = BadRequestCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case BADACTION:
- {
+ case BADACTION: {
BadActionCode errorCode = BadActionCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case BADINSTRUCTION:
- {
+ case BADINSTRUCTION: {
BadInstructionCode errorCode = BadInstructionCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case BADMATCH:
- {
+ case BADMATCH: {
BadMatchCode errorCode = BadMatchCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case FLOWMODFAILED:
- {
+ case FLOWMODFAILED: {
FlowModFailedCode errorCode = FlowModFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case GROUPMODFAILED:
- {
+ case GROUPMODFAILED: {
GroupModFailedCode errorCode = GroupModFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case PORTMODFAILED:
- {
+ case PORTMODFAILED: {
PortModFailedCode errorCode = PortModFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case TABLEMODFAILED:
- {
+ case TABLEMODFAILED: {
TableModFailedCode errorCode = TableModFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case QUEUEOPFAILED:
- {
+ case QUEUEOPFAILED: {
QueueOpFailedCode errorCode = QueueOpFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case SWITCHCONFIGFAILED:
- {
+ case SWITCHCONFIGFAILED: {
SwitchConfigFailedCode errorCode = SwitchConfigFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case ROLEREQUESTFAILED:
- {
+ case ROLEREQUESTFAILED: {
RoleRequestFailedCode errorCode = RoleRequestFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case METERMODFAILED:
- {
+ case METERMODFAILED: {
MeterModFailedCode errorCode = MeterModFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case TABLEFEATURESFAILED:
- {
+ case TABLEFEATURESFAILED: {
TableFeaturesFailedCode errorCode = TableFeaturesFailedCode.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
int code = rawMessage.readUnsignedShort();
if (type != null) {
switch (type) {
- case HELLOFAILED:
- {
+ case HELLOFAILED: {
HelloFailedCodeV10 errorCode = HelloFailedCodeV10.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case BADREQUEST:
- {
+ case BADREQUEST: {
BadRequestCodeV10 errorCode = BadRequestCodeV10.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case BADACTION:
- {
+ case BADACTION: {
BadActionCodeV10 errorCode = BadActionCodeV10.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case FLOWMODFAILED:
- {
+ case FLOWMODFAILED: {
FlowModFailedCodeV10 errorCode = FlowModFailedCodeV10.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case PORTMODFAILED:
- {
+ case PORTMODFAILED: {
PortModFailedCodeV10 errorCode = PortModFailedCodeV10.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
}
break;
}
- case QUEUEOPFAILED:
- {
+ case QUEUEOPFAILED: {
QueueOpFailedCodeV10 errorCode = QueueOpFailedCodeV10.forValue(code);
if (errorCode != null) {
setCode(builder, errorCode.getIntValue(), errorCode.name());
package org.opendaylight.openflowjava.protocol.impl.core;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
package org.opendaylight.openflowjava.protocol.impl.core;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SwitchIdleEvent;
idleHandler.channelRead(mockChHndlrCtx, new Object());
// Verify that a read was fired for the next handler ...
- verify(mockChHndlrCtx, times(1)).fireChannelRead(any(SwitchIdleEvent.class)) ;
+ verify(mockChHndlrCtx, times(1)).fireChannelRead(Mockito.<SwitchIdleEvent>any()) ;
}
/**
*/
package org.opendaylight.openflowjava.protocol.impl.core;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyShort;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyShort;
import static org.mockito.Mockito.when;
import io.netty.buffer.ByteBuf;
package org.opendaylight.openflowjava.protocol.impl.core;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyShort;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyShort;
import static org.mockito.Mockito.when;
import io.netty.buffer.ByteBuf;
*/
package org.opendaylight.openflowjava.protocol.impl.core;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyShort;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyShort;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.when;
package org.opendaylight.openflowjava.protocol.impl.core;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyShort;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyShort;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
package org.opendaylight.openflowjava.protocol.impl.core;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
package org.opendaylight.openflowjava.protocol.impl.core.connection;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
* Initializes deserializer registry and lookups OF13 deserializer.
*/
public BarrierReplyMessageFactoryTest() {
- super(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 21, BarrierOutput.class));
+ super(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 21, BarrierOutput.class));
}
/**
package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
+import static org.mockito.ArgumentMatchers.any;
+
import io.netty.buffer.ByteBuf;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void startUp() {
errorFactory = new ErrorMessageFactory();
- Mockito.when(registry.getDeserializer(Matchers.any(MessageCodeKey.class))).thenReturn(deserializer);
+ Mockito.when(registry.getDeserializer(any(MessageCodeKey.class))).thenReturn(deserializer);
errorFactory.injectDeserializerRegistry(registry);
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import io.netty.buffer.ByteBuf;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
*/
@Test
public void test() {
- Mockito.when(registry.getDeserializer(Matchers.<MessageCodeKey>any())).thenReturn(deserializer);
+ Mockito.when(registry.getDeserializer(ArgumentMatchers.<MessageCodeKey>any())).thenReturn(deserializer);
ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("01 02 03 04 FF FF FF FF 80 00 00 00");
VendorMessageFactory factory = new VendorMessageFactory();
factory.injectDeserializerRegistry(registry);
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
*/
@Test
public void testMultipartReplyExperimenter() {
- Mockito.when(registry.getDeserializer(Matchers.<MessageCodeKey>any())).thenReturn(vendorDeserializer);
+ Mockito.when(registry.getDeserializer(ArgumentMatchers.<MessageCodeKey>any())).thenReturn(vendorDeserializer);
factory.injectDeserializerRegistry(registry);
ByteBuf bb = BufferHelper.buildBuffer("FF FF 00 01 00 00 00 00 "
+ "00 00 00 01 00 00 00 02"); // expID, expType
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
*/
@Test
public void test() {
- Mockito.when(registry.getDeserializer(Matchers.<MessageCodeKey>any())).thenReturn(vendorDeserializer);
+ Mockito.when(registry.getDeserializer(ArgumentMatchers.<MessageCodeKey>any())).thenReturn(vendorDeserializer);
OF10StatsReplyMessageFactory factory = new OF10StatsReplyMessageFactory();
factory.injectDeserializerRegistry(registry);
package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
+import static org.mockito.ArgumentMatchers.any;
+
import io.netty.buffer.ByteBuf;
import org.junit.Test;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
ExperimenterInput input = builder.build();
Mockito.when(registry.getSerializer(
- (ExperimenterIdSerializerKey<?>) Matchers.any())).thenReturn(serializer);
+ (ExperimenterIdSerializerKey<?>) any())).thenReturn(serializer);
expFactory.serialize(input, out);
Mockito.verify(serializer, Mockito.times(1)).serialize(input.getExperimenterDataOfChoice(), out);
ExperimenterInput input = builder.build();
Mockito.when(registry.getSerializer(
- (ExperimenterIdSerializerKey<?>) Matchers.any())).thenReturn(serializer);
+ (ExperimenterIdSerializerKey<?>) any())).thenReturn(serializer);
expFactory.serialize(input, out);
Mockito.verify(serializer, Mockito.times(1)).serialize(input.getExperimenterDataOfChoice(), out);
import io.netty.buffer.PooledByteBufAllocator;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
*/
@Test
public void test() {
- Mockito.when(registry.getSerializer(Matchers.<MessageTypeKey<?>>any()))
+ Mockito.when(registry.getSerializer(ArgumentMatchers.<MessageTypeKey<?>>any()))
.thenReturn(serializer);
VendorInputMessageFactory factory = new VendorInputMessageFactory();
factory.injectSerializerRegistry(registry);
builder.setExperimenterDataOfChoice(vendorData);
ExperimenterInput experimenterInput = builder.build();
- Mockito.when(registry.getSerializer(Matchers.<ExperimenterIdSerializerKey<ExperimenterDataOfChoice>>any()))
+ Mockito.when(registry.getSerializer(
+ ArgumentMatchers.<ExperimenterIdSerializerKey<ExperimenterDataOfChoice>>any()))
.thenReturn(foundSerializer);
factory.serialize(experimenterInput, buffer);
Mockito.verify(foundSerializer, Mockito.times(1))
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Test
public void testExperimenter() throws Exception {
Mockito.when(mockRegistry.getSerializer(
- Matchers.<ExperimenterIdTypeSerializerKey<ExperimenterDataOfChoice>>any())).thenReturn(serializer);
+ ArgumentMatchers.<ExperimenterIdTypeSerializerKey<ExperimenterDataOfChoice>>any()))
+ .thenReturn(serializer);
MultipartRequestInputFactory multipartFactory = new MultipartRequestInputFactory();
multipartFactory.injectSerializerRegistry(mockRegistry);
MultipartRequestInputBuilder builder = new MultipartRequestInputBuilder();
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.factories.multipart;
+import static org.mockito.ArgumentMatchers.any;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
import java.math.BigInteger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
*/
@Before
public void startUp() {
- Mockito.when(mockRegistry.getSerializer((MessageTypeKey<?>)Matchers.any())).thenReturn(serializer);
+ Mockito.when(mockRegistry.getSerializer((MessageTypeKey<?>)any())).thenReturn(serializer);
registry = new SerializerRegistryImpl();
registry.init();
multipartFactory = registry.getSerializer(
new byte[] {0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01}, metadataWrite);
Assert.assertEquals("Wrong config", 8, out.readUnsignedInt());
Assert.assertEquals("Wrong max-entries", 65, out.readUnsignedInt());
- Mockito.verify(serializer, Mockito.times(2)).serialize(Matchers.any(TableFeatureProperties.class),
- Matchers.any(ByteBuf.class));
+ Mockito.verify(serializer, Mockito.times(2)).serialize(any(TableFeatureProperties.class),
+ any(ByteBuf.class));
}
}
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Test
public void testExperimenter() throws Exception {
Mockito.when(mockRegistry.getSerializer(
- Matchers.<ExperimenterIdTypeSerializerKey<ExperimenterDataOfChoice>>any())).thenReturn(serializer);
+ ArgumentMatchers.<ExperimenterIdTypeSerializerKey<ExperimenterDataOfChoice>>any()))
+ .thenReturn(serializer);
OF10StatsRequestInputFactory multipartFactory = new OF10StatsRequestInputFactory();
multipartFactory.injectSerializerRegistry(mockRegistry);
MultipartRequestInputBuilder builder = new MultipartRequestInputBuilder();
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
</plugins>
</build>
</project>
-
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<version>${infrautils.version}</version>
</dependency>
<dependency>
- <groupId>org.ops4j.pax.cdi</groupId>
- <artifactId>pax-cdi-api</artifactId>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>blueprint-maven-plugin-annotation</artifactId>
<optional>true</optional>
</dependency>
<dependency>
</plugins>
</build>
</project>
-
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
final FlowDescriptor flowDescriptor;
if (Objects.nonNull(input.getFlowRef())) {
- final FlowId flowId = input.getFlowRef().getValue().firstKeyOf(Flow.class, FlowKey.class).getId();
+ final FlowId flowId = input.getFlowRef().getValue().firstKeyOf(Flow.class).getId();
flowDescriptor = FlowDescriptorFactory.create(input.getTableId(), flowId);
deviceContext.getDeviceFlowRegistry().storeDescriptor(flowRegistryKey, flowDescriptor);
} else {
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.mdsal.common.api.TransactionChainClosedException;
+
+import org.opendaylight.mdsal.binding.api.TransactionChainClosedException;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
import org.opendaylight.openflowplugin.api.ConnectionException;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
package org.opendaylight.openflowplugin.impl;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
.thenReturn(THREAD_POOL_MAX_THREADS);
when(configurationService.getProperty(eq(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString()), any()))
.thenReturn(THREAD_POOL_TIMEOUT);
- when(configurationService.getProperty(eq(ConfigurationProperty.RPC_REQUESTS_QUOTA.toString()), any()))
- .thenReturn(RPC_REQUESTS_QUOTA);
- when(configurationService.getProperty(eq(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString()), any()))
- .thenReturn(GLOBAL_NOTIFICATION_QUOTA);
- when(configurationService.getProperty(eq(ConfigurationProperty.BASIC_TIMER_DELAY.toString()), any()))
- .thenReturn(BASIC_TIMER_DELAY);
when(configurationService.getProperty(eq(ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString()),
any())).thenReturn(DEVICE_CONNECTION_RATE_LIMIT_PER_MIN);
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package org.opendaylight.openflowplugin.impl.configuration;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import org.junit.After;
*/
package org.opendaylight.openflowplugin.impl.connection;
+import static org.mockito.ArgumentMatchers.any;
+
import com.google.common.util.concurrent.SettableFuture;
import java.math.BigInteger;
import java.net.InetSocketAddress;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final InetSocketAddress deviceAddress = InetSocketAddress.createUnresolved("yahoo", 42);
Mockito.when(connection.getRemoteAddress()).thenReturn(deviceAddress);
Mockito.when(connection.isAlive()).thenReturn(true);
- Mockito.when(connection.barrier(Matchers.<BarrierInput>any()))
+ Mockito.when(connection.barrier(ArgumentMatchers.<BarrierInput>any()))
.thenReturn(RpcResultBuilder.success(new BarrierOutputBuilder().build()).buildFuture());
}
// prepare void reply (hello rpc output)
final SettableFuture<RpcResult<HelloOutput>> voidResponseFx = SettableFuture.create();
- Mockito.when(connection.hello(Matchers.any(HelloInput.class))).thenReturn(voidResponseFx);
+ Mockito.when(connection.hello(any(HelloInput.class))).thenReturn(voidResponseFx);
// prepare getFeature reply (getFeture rpc output)
final SettableFuture<RpcResult<GetFeaturesOutput>> featureResponseFx =
SettableFuture.<RpcResult<GetFeaturesOutput>>create();
- Mockito.when(connection.getFeatures(Matchers.any(GetFeaturesInput.class))).thenReturn(featureResponseFx);
+ Mockito.when(connection.getFeatures(any(GetFeaturesInput.class))).thenReturn(featureResponseFx);
// fire handshake
featureResponseFx.set(rpcFeaturesOutput);
Mockito.verify(deviceConnectedHandler,
- Mockito.timeout(500)).deviceConnected(Matchers.any(ConnectionContext.class));
+ Mockito.timeout(500)).deviceConnected(any(ConnectionContext.class));
}
/**
// prepare void reply (hello rpc output)
final SettableFuture<RpcResult<HelloOutput>> voidResponseFx = SettableFuture.create();
- Mockito.when(connection.hello(Matchers.any(HelloInput.class))).thenReturn(voidResponseFx);
+ Mockito.when(connection.hello(any(HelloInput.class))).thenReturn(voidResponseFx);
// prepare getFeature reply (getFeture rpc output)
final SettableFuture<RpcResult<GetFeaturesOutput>> featureResponseFx =
SettableFuture.<RpcResult<GetFeaturesOutput>>create();
- Mockito.when(connection.getFeatures(Matchers.any(GetFeaturesInput.class))).thenReturn(featureResponseFx);
+ Mockito.when(connection.getFeatures(any(GetFeaturesInput.class))).thenReturn(featureResponseFx);
// fire handshake - send hello reply
featureResponseFx.set(rpcFeaturesOutput);
Mockito.verify(deviceConnectedHandler,
- Mockito.timeout(FINAL_STEP_TIMEOUT)).deviceConnected(Matchers.any(ConnectionContext.class));
+ Mockito.timeout(FINAL_STEP_TIMEOUT)).deviceConnected(any(ConnectionContext.class));
}
}
*/
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());
}
package org.opendaylight.openflowplugin.impl.connection.listener;
+import static org.mockito.ArgumentMatchers.any;
+
import java.math.BigInteger;
import java.net.InetSocketAddress;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void setUp() throws Exception {
- Mockito.when(connectionAdapter.barrier(Matchers.<BarrierInput>any()))
+ Mockito.when(connectionAdapter.barrier(ArgumentMatchers.<BarrierInput>any()))
.thenReturn(RpcResultBuilder.success(new BarrierOutputBuilder().build()).buildFuture());
connectionContextSpy = Mockito.spy(new ConnectionContextImpl(connectionAdapter));
Mockito.when(connectionContextSpy.getConnectionAdapter()).thenReturn(connectionAdapter);
public void testOnHandshakeSuccessfull() throws Exception {
handshakeListener.onHandshakeSuccessful(features, OFConstants.OFP_VERSION_1_3);
Mockito.verify(connectionContextSpy).changeStateToWorking();
- Mockito.verify(connectionContextSpy).setFeatures(Matchers.any(FeaturesReply.class));
+ Mockito.verify(connectionContextSpy).setFeatures(any(FeaturesReply.class));
Mockito.verify(connectionContextSpy).setNodeId(nodeIdCaptor.capture());
Mockito.verify(connectionContextSpy).handshakeSuccessful();
Mockito.verify(deviceConnectedHandler).deviceConnected(connectionContextSpy);
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
.setVersion(OFConstants.OFP_VERSION_1_3);
openflowProtocolListenerInitial.onEchoRequestMessage(echoRequestMessageBld.build());
- Mockito.verify(connectionAdapter).echoReply(Matchers.<EchoReplyInput>any());
+ Mockito.verify(connectionAdapter).echoReply(ArgumentMatchers.<EchoReplyInput>any());
}
@Test
.setVersion(OFConstants.OFP_VERSION_1_3);
openflowProtocolListenerInitial.onHelloMessage(helloMessageBld.build());
- Mockito.verify(handshakeManager).shake(Matchers.<HelloMessage>any());
+ Mockito.verify(handshakeManager).shake(ArgumentMatchers.<HelloMessage>any());
}
@Test
package org.opendaylight.openflowplugin.impl.connection.listener;
+import static org.mockito.ArgumentMatchers.any;
+
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.impl.connection.ConnectionContextImpl;
*/
@Test
public void testOnDisconnectEvent1() throws Exception {
- Mockito.when(connectionAdapter.isAlive()).thenReturn(true);
- Mockito.when(connectionAdapter.disconnect()).thenReturn(Futures.immediateFuture(Boolean.TRUE));
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
systemNotificationsListener.onDisconnectEvent(disconnectNotification);
*/
@Test
public void testOnDisconnectEvent2() throws Exception {
- Mockito.when(connectionAdapter.isAlive()).thenReturn(true);
- Mockito.when(connectionAdapter.disconnect()).thenReturn(Futures.immediateFuture(Boolean.FALSE));
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
systemNotificationsListener.onDisconnectEvent(disconnectNotification);
public void testOnDisconnectEvent3() throws Exception {
connectionContextGolem.changeStateToTimeouting();
- Mockito.when(connectionAdapter.isAlive()).thenReturn(true);
- Mockito.when(connectionAdapter.disconnect())
- .thenReturn(Futures.<Boolean>immediateFailedFuture(new Exception("unit exception")));
-
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
systemNotificationsListener.onDisconnectEvent(disconnectNotification);
@Test
public void testOnDisconnectEvent4() throws Exception {
Mockito.when(connectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.RIP);
- Mockito.when(connectionAdapter.isAlive()).thenReturn(false);
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
systemNotificationsListener.onDisconnectEvent(disconnectNotification);
final ListenableFuture<RpcResult<EchoOutput>> echoReply =
Futures.immediateFuture(RpcResultBuilder.success(new EchoOutputBuilder().setXid(0L).build()).build());
- Mockito.when(connectionAdapter.echo(Matchers.any(EchoInput.class))).thenReturn(echoReply);
+ Mockito.when(connectionAdapter.echo(any(EchoInput.class))).thenReturn(echoReply);
SwitchIdleEvent notification = new SwitchIdleEventBuilder().setInfo("wake up, device sleeps").build();
systemNotificationsListener.onSwitchIdleEvent(notification);
Thread.sleep(SAFE_TIMEOUT);
verifyCommonInvocations();
- Mockito.verify(connectionAdapter, Mockito.timeout(SAFE_TIMEOUT)).echo(Matchers.any(EchoInput.class));
+ Mockito.verify(connectionAdapter, Mockito.timeout(SAFE_TIMEOUT)).echo(any(EchoInput.class));
Mockito.verify(connectionAdapter, Mockito.never()).disconnect();
Mockito.verify(connectionContext).changeStateToTimeouting();
Mockito.verify(connectionContext).changeStateToWorking();
@Test
public void testOnSwitchIdleEvent2() throws Exception {
final SettableFuture<RpcResult<EchoOutput>> echoReply = SettableFuture.create();
- Mockito.when(connectionAdapter.echo(Matchers.any(EchoInput.class))).thenReturn(echoReply);
+ Mockito.when(connectionAdapter.echo(any(EchoInput.class))).thenReturn(echoReply);
Mockito.when(connectionAdapter.isAlive()).thenReturn(true);
Mockito.when(connectionAdapter.disconnect())
.thenReturn(Futures.<Boolean>immediateFailedFuture(new Exception("unit exception")));
Thread.sleep(SystemNotificationsListenerImpl.MAX_ECHO_REPLY_TIMEOUT + SAFE_TIMEOUT);
verifyCommonInvocations();
- Mockito.verify(connectionAdapter, Mockito.timeout(SAFE_TIMEOUT)).echo(Matchers.any(EchoInput.class));
+ Mockito.verify(connectionAdapter, Mockito.timeout(SAFE_TIMEOUT)).echo(any(EchoInput.class));
Mockito.verify(connectionAdapter).disconnect();
Mockito.verify(connectionContext).changeStateToTimeouting();
Mockito.verify(connectionContext).closeConnection(true);
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void setUp() throws Exception {
final CheckedFuture<Optional<Node>, ReadFailedException> noExistNodeFuture =
Futures.immediateCheckedFuture(Optional.<Node>absent());
- Mockito.when(readTx.read(LogicalDatastoreType.OPERATIONAL, nodeKeyIdent)).thenReturn(noExistNodeFuture);
+ Mockito.lenient().when(readTx.read(LogicalDatastoreType.OPERATIONAL, nodeKeyIdent))
+ .thenReturn(noExistNodeFuture);
Mockito.when(dataBroker.newReadOnlyTransaction()).thenReturn(readTx);
- Mockito.when(dataBroker.createTransactionChain(Mockito.any(TransactionChainManager.class)))
+ Mockito.when(dataBroker.createTransactionChain(any(TransactionChainManager.class)))
.thenReturn(txChainFactory);
Mockito.when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeKeyIdent);
Mockito.when(deviceInfo.getNodeId()).thenReturn(nodeId);
Mockito.when(deviceInfo.getDatapathId()).thenReturn(BigInteger.ONE);
final SettableFuture<RpcResult<GetAsyncReply>> settableFuture = SettableFuture.create();
final SettableFuture<RpcResult<MultipartReply>> settableFutureMultiReply = SettableFuture.create();
- Mockito.when(requestContext.getFuture()).thenReturn(settableFuture);
- Mockito.doAnswer(invocation -> {
+ Mockito.lenient().when(requestContext.getFuture()).thenReturn(settableFuture);
+ Mockito.lenient().doAnswer(invocation -> {
settableFuture.set((RpcResult<GetAsyncReply>) invocation.getArguments()[0]);
return null;
- }).when(requestContext).setResult(any(RpcResult.class));
+ }).when(requestContext).setResult(Mockito.<RpcResult>any());
- Mockito.when(requestContextMultiReply.getFuture()).thenReturn(settableFutureMultiReply);
- Mockito.doAnswer(invocation -> {
+ Mockito.lenient().when(requestContextMultiReply.getFuture()).thenReturn(settableFutureMultiReply);
+ Mockito.lenient().doAnswer(invocation -> {
settableFutureMultiReply.set((RpcResult<MultipartReply>) invocation.getArguments()[0]);
return null;
}).when(requestContextMultiReply).setResult(any(RpcResult.class));
Mockito.when(txChainFactory.newReadWriteTransaction()).thenReturn(writeTx);
Mockito.when(dataBroker.newReadOnlyTransaction()).thenReturn(readTx);
- Mockito.when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
+ Mockito.lenient().when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
Mockito.when(connectionContext.getConnectionAdapter()).thenReturn(connectionAdapter);
Mockito.when(connectionContext.getDeviceInfo()).thenReturn(deviceInfo);
final FeaturesReply mockedFeaturesReply = mock(FeaturesReply.class);
- when(connectionContext.getFeatures()).thenReturn(mockedFeaturesReply);
- when(connectionContext.getFeatures().getCapabilities()).thenReturn(mock(Capabilities.class));
+ lenient().when(connectionContext.getFeatures()).thenReturn(mockedFeaturesReply);
+ lenient().when(connectionContext.getFeatures().getCapabilities()).thenReturn(mock(Capabilities.class));
- Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
- Mockito.when(featuresOutput.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- Mockito.when(featuresOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+ Mockito.lenient().when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+ Mockito.lenient().when(featuresOutput.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
+ Mockito.lenient().when(featuresOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
Mockito.when(contextChainHolder.getContextChain(deviceInfo)).thenReturn(contextChain);
Mockito.when(contextChain.isMastered(ContextChainMastershipState.CHECK, false)).thenReturn(true);
.build())
.build();
- Mockito.when(messageTranslatorPacketReceived.translate(any(Object.class), any(DeviceInfo.class),
- any(Object.class))).thenReturn(packetReceived);
- Mockito.when(messageTranslatorFlowCapableNodeConnector.translate(any(Object.class), any(DeviceInfo.class),
- any(Object.class))).thenReturn(mock(FlowCapableNodeConnector.class));
+ Mockito.when(messageTranslatorPacketReceived.translate(Mockito.<Object>any(), Mockito.<DeviceInfo>any(),
+ Mockito.<Object>any())).thenReturn(packetReceived);
+ Mockito.when(messageTranslatorFlowCapableNodeConnector.translate(Mockito.<Object>any(),
+ Mockito.<DeviceInfo>any(),
+ Mockito.<Object>any())).thenReturn(mock(FlowCapableNodeConnector.class));
Mockito.when(translatorLibrary.lookupTranslator(eq(new TranslatorKey(OFConstants.OFP_VERSION_1_3,
PacketIn.class.getName())))).thenReturn(messageTranslatorPacketReceived);
Mockito.when(translatorLibrary.lookupTranslator(eq(new TranslatorKey(OFConstants.OFP_VERSION_1_3,
final java.util.Optional<AbstractDeviceInitializer> deviceInitializer = java.util.Optional
.of(this.abstractDeviceInitializer);
- Mockito.when(deviceInitializerProvider.lookup(OFConstants.OFP_VERSION_1_3)).thenReturn(deviceInitializer);
- Mockito.when(salRoleService.setRole(any())).thenReturn(Futures.immediateFuture(null));
+ Mockito.lenient().when(deviceInitializerProvider.lookup(OFConstants.OFP_VERSION_1_3))
+ .thenReturn(deviceInitializer);
+ Mockito.lenient().when(salRoleService.setRole(any())).thenReturn(Futures.immediateFuture(null));
deviceContext = new DeviceContextImpl(
connectionContext,
public void testProcessReply() {
final Error mockedError = mock(Error.class);
deviceContext.processReply(mockedError);
- verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE));
+ verify(messageSpy).spyMessage(Mockito.<Class>any(),
+ eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE));
final OfHeader mockedOfHeader = mock(OfHeader.class);
deviceContext.processReply(mockedOfHeader);
- verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
+ verify(messageSpy).spyMessage(Mockito.<Class>any(),
+ eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
}
@Test
final Error mockedError = mock(Error.class);
deviceContext.processReply(dummyXid, Lists.newArrayList(mockedError));
- verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE));
+ verify(messageSpy).spyMessage(Mockito.<Class>any(),
+ eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE));
final MultipartReply mockedMultipartReply = mock(MultipartReply.class);
deviceContext.processReply(dummyXid, Lists.newArrayList(mockedMultipartReply));
- verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
+ verify(messageSpy).spyMessage(Mockito.<Class>any(),
+ eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
}
@Test
.thenReturn(stringListenableFuture);
deviceContext.setNotificationPublishService(mockedNotificationPublishService);
deviceContext.processPacketInMessage(mockedPacketInMessage);
- verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH));
- verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
+ verify(messageSpy).spyMessage(Mockito.<Class>any(), eq(MessageSpy.StatisticsGroup.FROM_SWITCH));
+ verify(messageSpy).spyMessage(Mockito.<Class>any(),
+ eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
}
@Test
final NotificationPublishService mockedNotificationPublishService = mock(NotificationPublishService.class);
final ListenableFuture dummyFuture = Futures.immediateFailedFuture(new IllegalStateException());
- when(mockedNotificationPublishService.offerNotification(any(PacketReceived.class))).thenReturn(dummyFuture);
+ when(mockedNotificationPublishService.offerNotification(Mockito.<PacketReceived>any())).thenReturn(dummyFuture);
deviceContext.setNotificationPublishService(mockedNotificationPublishService);
deviceContext.processPacketInMessage(mockedPacketInMessage);
- verify(messageSpy).spyMessage(any(Class.class),
+ verify(messageSpy).spyMessage(Mockito.<Class>any(),
eq(MessageSpy.StatisticsGroup.FROM_SWITCH_NOTIFICATION_REJECTED));
}
final GetFeaturesOutput mockedFeature = mock(GetFeaturesOutput.class);
- when(mockedFeature.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
+ lenient().when(mockedFeature.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- when(mockedPortStatusMessage.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+ lenient().when(mockedPortStatusMessage.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
when(mockedPortStatusMessage.getReason()).thenReturn(PortReason.OFPPRADD);
when(mockedPortStatusMessage.getPortNo()).thenReturn(42L);
.setMatch(new MatchBuilder().build());
final NotificationPublishService mockedNotificationPublishService = mock(NotificationPublishService.class);
- Mockito.when(messageTranslatorFlowRemoved
+ Mockito.lenient().when(messageTranslatorFlowRemoved
.translate(any(Object.class), any(DeviceInfo.class), any(Object.class)))
.thenReturn(flowRemovedMdsalBld.build());
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.google.common.util.concurrent.ListenableFuture;
import io.netty.util.HashedWheelTimer;
import java.lang.reflect.Field;
-import java.math.BigInteger;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import org.junit.Assert;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
@Before
public void setUp() throws Exception {
- when(mockConnectionContext.getNodeId()).thenReturn(DUMMY_NODE_ID);
when(mockConnectionContext.getFeatures()).thenReturn(mockFeatures);
when(mockConnectionContext.getConnectionAdapter()).thenReturn(mockedConnectionAdapter);
when(mockConnectionContext.getDeviceInfo()).thenReturn(deviceInfo);
- when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockConnectionContext);
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(DUMMY_IDENTIFIER);
when(deviceInfo.getNodeId()).thenReturn(DUMMY_NODE_ID);
- when(mockFeatures.getCapabilities()).thenReturn(capabilities);
- when(mockFeatures.getCapabilitiesV10()).thenReturn(capabilitiesV10);
- when(mockFeatures.getDatapathId()).thenReturn(BigInteger.valueOf(21L));
-
when(mockedFuture.isDone()).thenReturn(true);
when(writeTransaction.submit()).thenReturn(mockedFuture);
- when(transactionChain.newWriteOnlyTransaction()).thenReturn(writeTransaction);
- when(dataBroker.createTransactionChain(any(TransactionChainListener.class))).thenReturn(transactionChain);
when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
deviceManager = new DeviceManagerImpl(
package org.opendaylight.openflowplugin.impl.device;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Assert.assertEquals(6, rateLimiter.getOccupiedPermits());
Assert.assertFalse(rateLimiter.isLimited());
- Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(Matchers.anyBoolean());
+ Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(anyBoolean());
}
private void acquirePermits(int permits) {
Assert.assertFalse(rateLimiter.isLimited());
caOrdered.verify(connectionAdapter).setPacketInFiltering(false);
- Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(Matchers.anyBoolean());
+ Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(anyBoolean());
}
@Test
Assert.assertFalse(rateLimiter.isLimited());
caOrdered.verify(connectionAdapter).setPacketInFiltering(false);
- Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(Matchers.anyBoolean());
+ Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(anyBoolean());
}
@Test
Assert.assertEquals(12, rateLimiter.getOccupiedPermits());
Assert.assertFalse(rateLimiter.isLimited());
- Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(Matchers.anyBoolean());
+ Mockito.verify(connectionAdapter, Mockito.times(2)).setPacketInFiltering(anyBoolean());
}
}
\ No newline at end of file
package org.opendaylight.openflowplugin.impl.device;
+import static org.mockito.ArgumentMatchers.any;
+
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
final ReadOnlyTransaction readOnlyTx = Mockito.mock(ReadOnlyTransaction.class);
final CheckedFuture<Optional<Node>, ReadFailedException> noExistNodeFuture = Futures
.immediateCheckedFuture(Optional.<Node>absent());
- Mockito.when(readOnlyTx.read(LogicalDatastoreType.OPERATIONAL, nodeKeyIdent)).thenReturn(noExistNodeFuture);
- Mockito.when(dataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTx);
- Mockito.when(dataBroker.createTransactionChain(Matchers.any(TransactionChainListener.class)))
+ Mockito.when(dataBroker.createTransactionChain(any(TransactionChainListener.class)))
.thenReturn(txChain);
nodeId = new NodeId("h2g2:42");
nodeKeyIdent = DeviceStateUtil.createNodeInstanceIdentifier(nodeId);
- Mockito.when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeKeyIdent);
- Mockito.when(deviceInfo.getNodeId()).thenReturn(nodeId);
txChainManager = new TransactionChainManager(dataBroker, nodeId.getValue());
Mockito.when(txChain.newReadWriteTransaction()).thenReturn(writeTx);
@Test
public void testDeactivateTransactionChainManagerFailed() throws Exception {
- Mockito.when(writeTx.submit()).thenReturn(
- Futures.<Void, TransactionCommitFailedException>immediateFailedCheckedFuture(
- new TransactionCommitFailedException("mock")));
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
package org.opendaylight.openflowplugin.impl.device.initialization;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package org.opendaylight.openflowplugin.impl.device.initialization;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
- when(translatorLibrary.lookupTranslator(any())).thenReturn(messageTranslator);
when(deviceContext.oook()).thenReturn(translatorLibrary);
when(requestContext.getXid()).thenReturn(new Xid(42L));
when(deviceContext.createRequestContext()).thenReturn(requestContext);
package org.opendaylight.openflowplugin.impl.device.listener;
+import static org.mockito.ArgumentMatchers.any;
+
import java.net.InetSocketAddress;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
connectionAdapter.setMessageListener(ofProtocolListener);
Mockito.when(connectionAdapter.getRemoteAddress())
.thenReturn(InetSocketAddress.createUnresolved("ofp-junit.example.org", 6663));
- Mockito.verify(connectionAdapter).setMessageListener(Matchers.any(OpenflowProtocolListener.class));
+ Mockito.verify(connectionAdapter).setMessageListener(any(OpenflowProtocolListener.class));
}
@After
.setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onEchoRequestMessage(echoRequestMessage);
- Mockito.verify(connectionAdapter).echoReply(Matchers.any(EchoReplyInput.class));
+ Mockito.verify(connectionAdapter).echoReply(any(EchoReplyInput.class));
}
/**
.setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onErrorMessage(errorMessage);
- Mockito.verify(deviceReplyProcessor).processReply(Matchers.any(ErrorMessage.class));
+ Mockito.verify(deviceReplyProcessor).processReply(any(ErrorMessage.class));
}
/**
.setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onExperimenterMessage(experimenterMessage);
- Mockito.verify(deviceReplyProcessor).processExperimenterMessage(Matchers.<ExperimenterMessage>any());
+ Mockito.verify(deviceReplyProcessor).processExperimenterMessage(ArgumentMatchers.<ExperimenterMessage>any());
}
/**
.setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onFlowRemovedMessage(flowRemovedMessage);
- Mockito.verify(deviceReplyProcessor).processFlowRemovedMessage(Matchers.any(FlowRemovedMessage.class));
+ Mockito.verify(deviceReplyProcessor).processFlowRemovedMessage(any(FlowRemovedMessage.class));
}
/**
.setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onPacketInMessage(packetInMessage);
- Mockito.verify(deviceReplyProcessor).processPacketInMessage(Matchers.any(PacketInMessage.class));
+ Mockito.verify(deviceReplyProcessor).processPacketInMessage(any(PacketInMessage.class));
}
/**
.setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onPortStatusMessage(portStatusMessage);
- Mockito.verify(deviceReplyProcessor).processPortStatusMessage(Matchers.any(PortStatusMessage.class));
+ Mockito.verify(deviceReplyProcessor).processPortStatusMessage(any(PortStatusMessage.class));
}
}
package org.opendaylight.openflowplugin.impl.karaf;
+import static org.mockito.ArgumentMatchers.anyString;
+
import com.google.common.base.Function;
import javax.annotation.Nullable;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
@After
public void tearDown() {
- Mockito.verify(console).print(Matchers.anyString());
+ Mockito.verify(console).print(anyString());
mi5.resetStatistics();
}
package org.opendaylight.openflowplugin.impl.karaf;
+import static org.mockito.ArgumentMatchers.anyString;
+
import com.google.common.base.Function;
import javax.annotation.Nullable;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
@After
public void tearDown() {
- Mockito.verify(console).print(Matchers.anyString());
+ Mockito.verify(console).print(anyString());
EventsTimeCounter.resetAllCounters();
}
package org.opendaylight.openflowplugin.impl.karaf;
+import static org.mockito.ArgumentMatchers.anyString;
+
import com.google.common.base.Function;
import javax.annotation.Nullable;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics;
@After
public void tearDown() {
- Mockito.verify(console).print(Matchers.anyString());
+ Mockito.verify(console).print(anyString());
SessionStatistics.resetAllCounters();
}
package org.opendaylight.openflowplugin.impl.karaf;
+import static org.mockito.ArgumentMatchers.contains;
+
import com.google.common.base.Function;
import javax.annotation.Nullable;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
showEventTimesComandProvider.execute(cmdSession);
Assert.assertFalse(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION));
- Mockito.verify(console).print(Matchers.contains("junitDevice"));
+ Mockito.verify(console).print(contains("junitDevice"));
}
}
\ No newline at end of file
package org.opendaylight.openflowplugin.impl.karaf;
+import static org.mockito.ArgumentMatchers.contains;
+
import com.google.common.base.Function;
import javax.annotation.Nullable;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics;
showSessionStatsCommandProvider.execute(cmdSession);
Assert.assertFalse(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION));
- Mockito.verify(console).print(Matchers.contains(dummySessionId));
+ Mockito.verify(console).print(contains(dummySessionId));
}
}
\ No newline at end of file
package org.opendaylight.openflowplugin.impl.karaf;
+import static org.mockito.ArgumentMatchers.matches;
+
import com.google.common.base.Function;
import javax.annotation.Nullable;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
@After
public void tearDown() throws Exception {
// Pattern.DOTALL is set inline via "(?s)" at the beginning
- Mockito.verify(console).print(Matchers.matches("(?s).+"));
+ Mockito.verify(console).print(matches("(?s).+"));
messageIntelligenceAgency.resetStatistics();
}
@Before
public void setUp() throws Exception {
- Mockito.doAnswer(invocation -> {
- invocation.getArgumentAt(0, Runnable.class).run();
- return null;
- }).when(executorService).submit(Mockito.<Runnable>any());
-
Mockito.when(connectionContext.getDeviceInfo()).thenReturn(deviceInfo);
Mockito.when(deviceManager.createContext(connectionContext)).thenReturn(deviceContext);
@Test
public void reconciliationFrameworkSuccessButNotSubmit() throws Exception {
contextChainHolder.createContextChain(connectionContext);
- Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
- .thenReturn(Futures.immediateFuture(ResultState.DONOTHING));
contextChainHolder.createContextChain(connectionContext);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.RPC_REGISTRATION);
Mockito.when(rpcContext.closeServiceInstance()).thenReturn(Futures.immediateFuture(null));
Mockito.when(statisticsContext.closeServiceInstance()).thenReturn(Futures.immediateFuture(null));
Mockito.when(connectionContext.getDeviceInfo()).thenReturn(deviceInfo);
- Mockito.when(connectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
Mockito.when(clusterSingletonServiceProvider.registerClusterSingletonService(Mockito.any()))
.thenReturn(clusterSingletonServiceRegistration);
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
flowAndStatisticsMapListList.add(TestFlowHelper.createFlowAndStatisticsMapListBuilder(i).build());
}
FLOWS_STATISTICS_UPDATE_BUILDER.setFlowAndStatisticsMapList(flowAndStatisticsMapListList);
- Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
}
package org.opendaylight.openflowplugin.impl.role;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
final NodeId nodeId = new NodeId("openflow:1");
nodeInstanceIdentifier = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId));
- when(deviceContext.getDeviceState()).thenReturn(deviceState);
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
.setVersion(OFConstants.OFP_VERSION_1_3)
.build();
- Mockito.when(deviceInfo.getNodeId()).thenReturn(nodeKey.getId());
Mockito.when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodePath);
- Mockito.when(connectionContext.getFeatures()).thenReturn(features);
- Mockito.when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
- Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
Mockito.when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
- Mockito.when(rpcProviderRegistry.addRoutedRpcImplementation(
- Matchers.any(), Matchers.any(RpcService.class)))
- .thenReturn(routedRpcRegistration);
- Mockito.when(contexts.remove(deviceInfo)).thenReturn(removedContexts);
}
@Test
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
Mockito.when(deviceContext.getMessageSpy()).thenReturn(spy);
final OngoingStubbing<MultiMsgCollector<MultipartReply>> when =
- Mockito.when(deviceContext.getMultiMsgCollector(Matchers.any()));
+ Mockito.when(deviceContext.getMultiMsgCollector(ArgumentMatchers.any()));
when.thenReturn(multiMsgCollector);
multipartRequestCallback = new MultiLayerMultipartRequestCallback<>(requestContext,
MultipartRequestInput.class,
@Test
public void testOnSuccess1() throws Exception {
multipartRequestCallback.onSuccess(null);
- Mockito.verify(multiMsgCollector).endCollecting(Matchers.<EventIdentifier>any());
+ Mockito.verify(multiMsgCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
}
/**
final MultipartReplyMessage replyMessage = new MultipartReplyMessageBuilder().build();
multipartRequestCallback.onSuccess(replyMessage);
Mockito.verify(multiMsgCollector)
- .addMultipartMsg(Matchers.eq(replyMessage), Matchers.eq(false), Matchers.any());
+ .addMultipartMsg(ArgumentMatchers.eq(replyMessage), ArgumentMatchers.eq(false), ArgumentMatchers.any());
}
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
public void initialization() {
when(mockedDeviceContext.getMessageSpy()).thenReturn(new MessageIntelligenceAgencyImpl());
when(mockedNodeId.toString()).thenReturn(DUMMY_NODE_ID);
- when(mockedPrimaryConnection.getNodeId()).thenReturn(mockedNodeId);
when(mockedPrimaryConnection.getFeatures()).thenReturn(mockedFeaturesReply);
- when(mockedFeaturesReply.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
- when(mockedFeaturesReply.getDatapathId()).thenReturn(BigInteger.valueOf(123L));
-
- when(mocketGetFeaturesOutput.getTables()).thenReturn(tableId);
- when(mocketGetFeaturesOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
- when(mocketGetFeaturesOutput.getDatapathId()).thenReturn(BigInteger.valueOf(123L));
when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimaryConnection);
when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(NODE_PATH);
when(mockedDeviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
when(mockedDeviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
- when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(mockedFlowRegistry);
- when(mockedFlowRegistry.retrieveDescriptor(Matchers.any(FlowRegistryKey.class)))
+ when(mockedFlowRegistry.retrieveDescriptor(any(FlowRegistryKey.class)))
.thenReturn(mockedFlowDescriptor);
final InstanceIdentifier<FlowCapableNode> nodePath =
final Optional<FlowCapableNode> flowNodeOpt = Optional.of(flowNodeBuilder.build());
final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture =
Futures.immediateCheckedFuture(flowNodeOpt);
- when(mockedReadOnlyTx.read(LogicalDatastoreType.OPERATIONAL, nodePath)).thenReturn(flowNodeFuture);
- when(mockedDeviceContext.getReadTransaction()).thenReturn(mockedReadOnlyTx);
-
dummyRequestContext = new AbstractRequestContext<List<MultipartReply>>(DUMMY_XID) {
@Override
assertEquals(expectedRpcResult.isSuccessful(), actualResult.isSuccessful());
Mockito.verify(mockedDeviceContext, Mockito.never())
- .writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.<InstanceIdentifier>any(), Matchers.<DataObject>any());
+ .writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
+ ArgumentMatchers.<InstanceIdentifier>any(), ArgumentMatchers.<DataObject>any());
Mockito.verify(mockedDeviceContext).submitTransaction();
}
final Optional<FlowCapableNode> flowNodeOpt = Optional.of(flowNodeBuilder.build());
final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture = Futures
.immediateCheckedFuture(flowNodeOpt);
- when(mockedReadOnlyTx.read(LogicalDatastoreType.OPERATIONAL, nodePath)).thenReturn(flowNodeFuture);
- when(mockedDeviceContext.getReadTransaction()).thenReturn(mockedReadOnlyTx);
multipartRequestOnTheFlyCallback.onSuccess(mpReplyMessage.build());
verify(mockedReadOnlyTx, times(0)).read(LogicalDatastoreType.OPERATIONAL, nodePath);
verify(mockedReadOnlyTx, times(0)).close();
verify(mockedDeviceContext, times(1)).writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.any(), Matchers.any());
+ any(), any());
}
/**
// Nothing else than flow is supported by on the fly callback
assertNotNull(actualResult.getErrors());
assertFalse(actualResult.getErrors().isEmpty());
- Mockito.verify(mockedFlowRegistry, Mockito.never()).store(Matchers.any());
+ Mockito.verify(mockedFlowRegistry, Mockito.never()).store(any());
Mockito.verify(mockedDeviceContext, Mockito.never())
- .writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.<InstanceIdentifier>any(), Matchers.<DataObject>any());
+ .writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
+ ArgumentMatchers.<InstanceIdentifier>any(), ArgumentMatchers.<DataObject>any());
}
}
*/
package org.opendaylight.openflowplugin.impl.services;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when;
import com.google.common.util.concurrent.Futures;
@Before
@SuppressWarnings("unchecked")
public void initialization() throws Exception {
- when(mockedExtensionConverter.getExperimenterId())
+ lenient().when(mockedExtensionConverter.getExperimenterId())
.thenReturn(new ExperimenterId(DUMMY_EXPERIMENTER_ID));
- when(mockedExtensionConverterProvider.getMessageConverter(Matchers.<TypeVersionKey>any()))
+ lenient().when(mockedExtensionConverterProvider.getMessageConverter(Matchers.<TypeVersionKey>any()))
.thenReturn(mockedExtensionConverter);
- when(mockedRequestContextStack.createRequestContext()).thenReturn(mockedRequestContext);
- when(mockedRequestContext.getXid()).thenReturn(DUMMY_XID);
- when(mockedFeatures.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- when(mockedFeatures.getVersion()).thenReturn(DUMMY_VERSION);
+ lenient().when(mockedRequestContextStack.createRequestContext()).thenReturn(mockedRequestContext);
+ lenient().when(mockedRequestContext.getXid()).thenReturn(DUMMY_XID);
+ lenient().when(mockedFeatures.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
+ lenient().when(mockedFeatures.getVersion()).thenReturn(DUMMY_VERSION);
- when(mockedFeaturesOutput.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- when(mockedFeaturesOutput.getVersion()).thenReturn(DUMMY_VERSION);
+ lenient().when(mockedFeaturesOutput.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
+ lenient().when(mockedFeaturesOutput.getVersion()).thenReturn(DUMMY_VERSION);
- when(mockedPrimConnectionContext.getFeatures()).thenReturn(mockedFeatures);
- when(mockedPrimConnectionContext.getConnectionAdapter()).thenReturn(mockedConnectionAdapter);
- when(mockedPrimConnectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
- when(mockedPrimConnectionContext.getOutboundQueueProvider()).thenReturn(mockedOutboundQueue);
+ lenient().when(mockedPrimConnectionContext.getFeatures()).thenReturn(mockedFeatures);
+ lenient().when(mockedPrimConnectionContext.getConnectionAdapter()).thenReturn(mockedConnectionAdapter);
+ lenient().when(mockedPrimConnectionContext.getConnectionState())
+ .thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
+ lenient().when(mockedPrimConnectionContext.getOutboundQueueProvider()).thenReturn(mockedOutboundQueue);
- when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(DUMMY_NODE_II);
+ lenient().when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(DUMMY_NODE_II);
when(mockedDeviceInfo.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
when(mockedDeviceInfo.getVersion()).thenReturn(DUMMY_VERSION);
- when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
+ lenient().when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessagSpy);
- when(mockedDeviceContext.getDeviceFlowRegistry())
+ lenient().when(mockedDeviceContext.getDeviceFlowRegistry())
.thenReturn(new DeviceFlowRegistryImpl(DUMMY_VERSION, dataBroker, DUMMY_NODE_II));
- when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
+ lenient().when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
- when(mockedDeviceContext.getMultiMsgCollector(Matchers.any())).thenReturn(multiMessageCollector);
+ lenient().when(mockedDeviceContext.getMultiMsgCollector(Matchers.any())).thenReturn(multiMessageCollector);
setup();
}
package org.opendaylight.openflowplugin.impl.services.sal;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import com.google.common.util.concurrent.FutureCallback;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
Assert.assertTrue(getAsyncResult.isDone());
Assert.assertTrue(getAsyncResult.get().isSuccessful());
verify(mockedRequestContextStack).createRequestContext();
- verify(mockedOutboundQueue).commitEntry(Matchers.eq(ServiceMocking.DUMMY_XID_VALUE),
- Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
+ verify(mockedOutboundQueue).commitEntry(eq(ServiceMocking.DUMMY_XID_VALUE),
+ ArgumentMatchers.<OfHeader>any(), ArgumentMatchers.<FutureCallback<OfHeader>>any());
}
}
package org.opendaylight.openflowplugin.impl.services.sal;
+import static org.mockito.ArgumentMatchers.any;
+
import com.google.common.util.concurrent.SettableFuture;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
experimenterBuilder.setExperimenterMessageOfChoice(new BundleControlSalBuilder()
.setSalControlData(new SalControlDataBuilder(input).build())
.build());
- Mockito.when(experimenterMessageService.sendExperimenter(Matchers.any())).thenReturn(SettableFuture.create());
+ Mockito.when(experimenterMessageService.sendExperimenter(any())).thenReturn(SettableFuture.create());
service.controlBundle(input);
Mockito.verify(experimenterMessageService).sendExperimenter(experimenterBuilder.build());
}
final BundleAddMessageSalBuilder addMessageBuilder = new BundleAddMessageSalBuilder();
final SendExperimenterInputBuilder experimenterBuilder = new SendExperimenterInputBuilder()
.setNode(NODE_REF);
- Mockito.when(experimenterMessageService.sendExperimenter(Matchers.any())).thenReturn(SettableFuture.create());
+ Mockito.when(experimenterMessageService.sendExperimenter(any())).thenReturn(SettableFuture.create());
service.addBundleMessages(input);
for (Message msg : innerMessages) {
Mockito.verify(experimenterMessageService)
package org.opendaylight.openflowplugin.impl.services.sal;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import com.google.common.util.concurrent.FutureCallback;
import java.util.concurrent.Future;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
import org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoInput;
Assert.assertTrue(echoOutput.get().isSuccessful());
verify(mockedRequestContextStack).createRequestContext();
verify(mockedOutboundQueue)
- .commitEntry(Matchers.eq(2121L), Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
+ .commitEntry(eq(2121L), ArgumentMatchers.<OfHeader>any(),
+ ArgumentMatchers.<FutureCallback<OfHeader>>any());
}
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import org.junit.Test;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
salExperimenterMessageService = new SalExperimenterMessageServiceImpl(mockedRequestContextStack,
mockedDeviceContext,
extensionConverterProvider);
- Mockito.when(extensionConverterProvider.getMessageConverter(Matchers.<TypeVersionKey>any()))
+ Mockito.when(extensionConverterProvider.getMessageConverter(ArgumentMatchers.<TypeVersionKey>any()))
.thenReturn(extensionConverter);
Mockito.when(extensionConverter.getExperimenterId()).thenReturn(new ExperimenterId(43L));
Mockito.when(extensionConverter.getType()).thenReturn(44L);
final ExperimenterInput input = (ExperimenterInput) request;
assertEquals(43L, input.getExperimenter().getValue().longValue());
assertEquals(44L, input.getExpType().longValue());
- Mockito.verify(extensionConverter).convert(Matchers.eq(sendExperimenterInput.getExperimenterMessageOfChoice()),
- Matchers.any(ExtensionConvertorData.class));
+ Mockito.verify(extensionConverter).convert(eq(sendExperimenterInput.getExperimenterMessageOfChoice()),
+ ArgumentMatchers.any(ExtensionConvertorData.class));
}
private SendExperimenterInput buildSendExperimenterInput() {
package org.opendaylight.openflowplugin.impl.services.sal;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import java.util.List;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
public class SalExperimenterMpMessageServiceImplTest extends ServiceMocking {
@SuppressWarnings("unchecked")
protected void setup() {
this.<List<MultipartReply>>mockSuccessfulFuture();
- when(mockedExtensionConverter.getType())
- .thenReturn((long) MultipartType.OFPMPEXPERIMENTER.getIntValue());
salExperimenterMpMessageService = new SalExperimenterMpMessageServiceImpl(
mockedRequestContextStack,
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Test
public void testProcessFlatBatch_allSuccessFinished() throws Exception {
- Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new AddFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salFlowsBatchService.removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new RemoveFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salFlowsBatchService.updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new UpdateFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.addGroupsBatch(Matchers.<AddGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new AddGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new RemoveGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new UpdateGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.addMetersBatch(Matchers.<AddMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new AddMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.removeMetersBatch(Matchers.<RemoveMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new RemoveMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.updateMetersBatch(Matchers.<UpdateMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new UpdateMetersBatchOutputBuilder().build()).buildFuture());
Assert.assertTrue(rpcResult.getResult().getBatchFailure().isEmpty());
final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
- inOrder.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any());
- inOrder.verify(salGroupsBatchService).addGroupsBatch(Matchers.<AddGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any());
- inOrder.verify(salMetersBatchService).addMetersBatch(Matchers.<AddMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).removeMetersBatch(Matchers.<RemoveMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).updateMetersBatch(Matchers.<UpdateMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any());
}
@Test
Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
- inOrder.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any());
- inOrder.verify(salGroupsBatchService).addGroupsBatch(Matchers.<AddGroupsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any());
}
@Test
Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
- inOrder.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any());
- inOrder.verify(salGroupsBatchService).addGroupsBatch(Matchers.<AddGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any());
- inOrder.verify(salMetersBatchService).addMetersBatch(Matchers.<AddMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).removeMetersBatch(Matchers.<RemoveMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).updateMetersBatch(Matchers.<UpdateMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any());
}
private void prepareFirstFailingMockService() {
- Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new AddFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salFlowsBatchService.removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder.<RemoveFlowsBatchOutput>failed()
.withResult(new RemoveFlowsBatchOutputBuilder()
.setBatchFailedFlowsOutput(Lists.newArrayList(
.build())
.withError(RpcError.ErrorType.APPLICATION, "ut-firstFlowAddError")
.buildFuture());
- Mockito.when(salFlowsBatchService.updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new UpdateFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.addGroupsBatch(Matchers.<AddGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new AddGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new RemoveGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new UpdateGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.addMetersBatch(Matchers.<AddMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new AddMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.removeMetersBatch(Matchers.<RemoveMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new RemoveMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.updateMetersBatch(Matchers.<UpdateMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any()))
.thenReturn(RpcResultBuilder.success(new UpdateMetersBatchOutputBuilder().build()).buildFuture());
}
createFlowBatchFailure(1, "f2")))
.buildFuture();
- Mockito.when(batchStepJob1.getStepFunction().apply(Matchers.<RpcResult<ProcessFlatBatchOutput>>any()))
+ Mockito.when(batchStepJob1.getStepFunction().apply(ArgumentMatchers.<RpcResult<ProcessFlatBatchOutput>>any()))
.thenReturn(succeededChainOutput);
- Mockito.when(batchStepJob2.getStepFunction().apply(Matchers.<RpcResult<ProcessFlatBatchOutput>>any()))
+ Mockito.when(batchStepJob2.getStepFunction().apply(ArgumentMatchers.<RpcResult<ProcessFlatBatchOutput>>any()))
.thenReturn(failedChainOutput);
final List<BatchStepJob> batchChainElements = Lists.newArrayList(batchStepJob1, batchStepJob2);
Assert.assertEquals(1, batchChain.size());
- Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder
.success(new AddFlowsBatchOutputBuilder().build())
.buildFuture());
Assert.assertEquals(0, rpcResult.getErrors().size());
Assert.assertEquals(0, rpcResult.getResult().getBatchFailure().size());
- Mockito.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
+ Mockito.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
}
@Test
Assert.assertEquals(2, batchChain.size());
- Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
.thenReturn(RpcResultBuilder
.<AddFlowsBatchOutput>failed()
.withResult(new AddFlowsBatchOutputBuilder()
*/
package org.opendaylight.openflowplugin.impl.services.sal;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void initialization() {
- when(mockedFeatures.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- when(mockedFeaturesOutput.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- when(mockedPrimConnectionContext.getFeatures()).thenReturn(mockedFeatures);
- when(mockedPrimConnectionContext.getConnectionAdapter()).thenReturn(mockedConnectionAdapter);
when(mockedPrimConnectionContext.getOutboundQueueProvider()).thenReturn(outboundQueue);
when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
when(requestContext.getFuture()).thenReturn(RpcResultBuilder.success().buildFuture());
when(mockedRequestContextStack.createRequestContext()).thenReturn(requestContext);
- when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(NODE_II);
when(mockedDeviceInfo.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
}
FlowDescriptor mockedFlowDescriptor = mock(FlowDescriptor.class);
FlowId flowId = new FlowId(DUMMY_FLOW_ID);
when(mockedFlowDescriptor.getFlowId()).thenReturn(flowId);
- when(mockedFlowDescriptor.getTableKey()).thenReturn(new TableKey(DUMMY_TABLE_ID));
when(deviceFlowRegistry
- .retrieveDescriptor(Matchers.any(FlowRegistryKey.class))).thenReturn(mockedFlowDescriptor);
+ .retrieveDescriptor(any(FlowRegistryKey.class))).thenReturn(mockedFlowDescriptor);
}
private <T extends DataObject> void verifyOutput(Future<RpcResult<T>> rpcResultFuture) throws ExecutionException,
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
public void setUp() throws Exception {
salFlowsBatchService = new SalFlowsBatchServiceImpl(salFlowService, transactionService);
- Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
+ Mockito.when(transactionService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
@Test
public void testRemoveFlowsBatch_success() throws Exception {
- Mockito.when(salFlowService.removeFlow(Matchers.<RemoveFlowInput>any()))
+ Mockito.when(salFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
.thenReturn(RpcResultBuilder.success(new RemoveFlowOutputBuilder().build())
.buildFuture());
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
public void testRemoveFlowsBatch_failed() throws Exception {
- Mockito.when(salFlowService.removeFlow(Matchers.<RemoveFlowInput>any()))
+ Mockito.when(salFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
.thenReturn(RpcResultBuilder.<RemoveFlowOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "flow-remove-fail-1")
.buildFuture());
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
private static BatchAddFlows createEmptyBatchAddFlow(final String flowIdValue, final int priority) {
@Test
public void testAddFlowsBatch_success() throws Exception {
- Mockito.when(salFlowService.addFlow(Matchers.<AddFlowInput>any()))
+ Mockito.when(salFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
final AddFlowsBatchInput input = new AddFlowsBatchInputBuilder()
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
public void testAddFlowsBatch_failed() throws Exception {
- Mockito.when(salFlowService.addFlow(Matchers.<AddFlowInput>any()))
+ Mockito.when(salFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
.thenReturn(RpcResultBuilder
.<AddFlowOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
.buildFuture());
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
public void testUpdateFlowsBatch_success() throws Exception {
- Mockito.when(salFlowService.updateFlow(Matchers.<UpdateFlowInput>any()))
+ Mockito.when(salFlowService.updateFlow(ArgumentMatchers.<UpdateFlowInput>any()))
.thenReturn(RpcResultBuilder.success(new UpdateFlowOutputBuilder().build()).buildFuture());
final UpdateFlowsBatchInput input = new UpdateFlowsBatchInputBuilder()
Assert.assertEquals(44, allValues.get(1).getOriginalFlow().getPriority().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedFlow().getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
public void testUpdateFlowsBatch_failure() throws Exception {
- Mockito.when(salFlowService.updateFlow(Matchers.<UpdateFlowInput>any()))
+ Mockito.when(salFlowService.updateFlow(ArgumentMatchers.<UpdateFlowInput>any()))
.thenReturn(RpcResultBuilder.<UpdateFlowOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-flowUpdateError")
.buildFuture());
Assert.assertEquals(44, allValues.get(1).getOriginalFlow().getPriority().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedFlow().getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
}
package org.opendaylight.openflowplugin.impl.services.sal;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import org.junit.Test;
-
import org.mockito.Mock;
import org.opendaylight.openflowplugin.api.openflow.registry.group.DeviceGroupRegistry;
import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
@Override
protected void setup() {
- when(mockedDeviceContext.getDeviceGroupRegistry()).thenReturn(mockedDeviceGroupRegistry);
final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
salGroupService = new SalGroupServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
}
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
public void setUp() throws Exception {
salGroupsBatchService = new SalGroupsBatchServiceImpl(salGroupService, transactionService);
- Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
+ Mockito.when(transactionService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
Assert.assertEquals(44, allValues.get(1).getOriginalGroup().getGroupId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedGroup().getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(44, allValues.get(1).getOriginalGroup().getGroupId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedGroup().getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
private static BatchAddGroups createEmptyBatchAddGroup(final long groupIdValue) {
package org.opendaylight.openflowplugin.impl.services.sal;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import org.junit.Test;
import org.mockito.Mock;
@Override
protected void setup() {
- when(mockedDeviceContext.getDeviceMeterRegistry()).thenReturn(mockedDeviceMeterRegistry);
final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
salMeterService = new SalMeterServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
}
package org.opendaylight.openflowplugin.impl.services.sal;
+import static org.mockito.ArgumentMatchers.any;
+
import com.google.common.collect.Lists;
import java.util.List;
import java.util.concurrent.Future;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
public void setUp() throws Exception {
salMetersBatchService = new SalMetersBatchServiceImpl(salMeterService, transactionService);
- Mockito.when(transactionService.sendBarrier(Matchers.any()))
+ Mockito.when(transactionService.sendBarrier(any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
Assert.assertEquals(44, allValues.get(1).getOriginalMeter().getMeterId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedMeter().getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(44, allValues.get(1).getOriginalMeter().getMeterId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedMeter().getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
@Test
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
}
private static BatchAddMeters createEmptyBatchAddMeter(final long groupIdValue) {
*/
package org.opendaylight.openflowplugin.impl.services.sal;
+import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.concurrent.Future;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
return null;
})
.when(mockedOutboundQueue).commitEntry(
- Matchers.anyLong(), Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
+ anyLong(), ArgumentMatchers.<OfHeader>any(), ArgumentMatchers.<FutureCallback<OfHeader>>any());
final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
salTableService = new SalTableServiceImpl(mockedRequestContextStack, mockedDeviceContext,
RpcResultBuilder.<List<MultipartReply>>failed().build();
handleResultFuture.set(rpcResult);
return null;
- }).when(multiMessageCollector).endCollecting(Matchers.<EventIdentifier>any());
+ }).when(multiMessageCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
Assert.assertNotNull(rpcResultFuture);
.build();
handleResultFuture.set(rpcResult);
return null;
- }).when(multiMessageCollector).endCollecting(Matchers.<EventIdentifier>any());
+ }).when(multiMessageCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
Assert.assertNotNull(rpcResultFuture);
.build();
handleResultFuture.set(rpcResult);
return null;
- }).when(multiMessageCollector).endCollecting(Matchers.<EventIdentifier>any());
+ }).when(multiMessageCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
Assert.assertNotNull(rpcResultFuture);
package org.opendaylight.openflowplugin.impl.services.util;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessageSpy);
when(mockedDeviceInfo.getNodeId()).thenReturn(DUMMY_NODE_ID.getKey().getId());
- when(mockedConnectionContext.getNodeId()).thenReturn(DUMMY_NODE_ID.getKey().getId());
when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeatures);
when(mockedConnectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
- when(mockedConnectionContext.getOutboundQueueProvider()).thenReturn(mockedOutboundQueue);
}
}
package org.opendaylight.openflowplugin.impl.statistics;
import static com.google.common.util.concurrent.Futures.immediateFuture;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
statisticsContext.instantiateServiceInstance();
verify(mockedStatisticsGatheringService, times(7))
- .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class));
+ .getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class));
verify(mockedStatisticsOnFlyGatheringService)
- .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class));
+ .getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class));
}
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
initStatisticsContext();
when(mockedStatisticsGatheringService
- .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class)))
+ .getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class)))
.thenReturn(Futures.immediateFuture(
RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build()));
when(mockedStatisticsOnFlyGatheringService
- .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class)))
+ .getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class)))
.thenReturn(Futures.immediateFuture(
RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build()));
statisticsContext.instantiateServiceInstance();
verify(mockedStatisticsGatheringService, times(7))
- .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class));
+ .getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class));
verify(mockedStatisticsOnFlyGatheringService)
- .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class));
+ .getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class));
Mockito.verifyNoMoreInteractions(mockedStatisticsGatheringService, mockedStatisticsOnFlyGatheringService);
}
}
package org.opendaylight.openflowplugin.impl.statistics;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.InOrder;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void setUp() throws Exception {
- when(deviceContext.getDeviceState()).thenReturn(deviceState);
when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
when(deviceContext.getDeviceFlowRegistry()).thenReturn(deviceFlowRegistry);
when(deviceContext.getDeviceGroupRegistry()).thenReturn(deviceGroupRegistry);
when(deviceContext.getDeviceMeterRegistry()).thenReturn(deviceMeterRegistry);
- when(deviceFlowRegistry.retrieveDescriptor(Matchers.any(FlowRegistryKey.class))).thenReturn(flowDescriptor);
+ when(deviceFlowRegistry.retrieveDescriptor(any(FlowRegistryKey.class))).thenReturn(flowDescriptor);
when(deviceContext.getReadTransaction()).thenReturn(readTx);
when(deviceContext.getReadTransaction()).thenReturn(readTx);
when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionAdapter);
when(deviceContext.isTransactionsEnabled()).thenReturn(Boolean.TRUE);
- when(connectionAdapter.getNodeId()).thenReturn(DUMMY_NODE_ID);
when(connectionAdapter.getFeatures()).thenReturn(features);
when(features.getDatapathId()).thenReturn(BigInteger.ONE);
when(features.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
dataStoreType.capture(), flowPath.capture(), flow.capture());
Assert.assertEquals(LogicalDatastoreType.OPERATIONAL, dataStoreType.getValue());
final InstanceIdentifier<FlowCapableNode> flowCapableNodePath = flowPath.getValue();
- Assert.assertEquals(DUMMY_NODE_ID, flowCapableNodePath.firstKeyOf(Node.class, NodeKey.class).getId());
+ Assert.assertEquals(DUMMY_NODE_ID, flowCapableNodePath.firstKeyOf(Node.class).getId());
Assert.assertEquals(42, flow.getValue().getTableId().intValue());
}
.opendaylight.group.types.rev131018.GroupId(groupIdValue)))
.augmentation(NodeGroupStatistics.class)
.child(GroupStatistics.class);
- verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.eq(groupPath), Matchers.any(GroupStatistics.class));
+ verify(deviceContext).writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
+ eq(groupPath), any(GroupStatistics.class));
}
@Test
final KeyedInstanceIdentifier<Group, GroupKey> groupPath =
dummyNodePath.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(storedGroupId));
- verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.<InstanceIdentifier<?>>any());
+ verify(deviceContext, Mockito.never()).addDeleteToTxChain(eq(LogicalDatastoreType.OPERATIONAL),
+ ArgumentMatchers.<InstanceIdentifier<?>>any());
verify(deviceGroupRegistry).store(storedGroupId);
- verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.eq(groupPath), Matchers.any(Group.class));
+ verify(deviceContext).writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
+ eq(groupPath), any(Group.class));
}
@Test
.opendaylight.meter.types.rev130918.MeterId(meterIdValue)))
.augmentation(NodeMeterStatistics.class)
.child(MeterStatistics.class);
- verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.eq(meterPath), Matchers.any(MeterStatistics.class));
+ verify(deviceContext).writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
+ eq(meterPath), any(MeterStatistics.class));
}
@Test
.augmentation(FlowCapableNodeConnectorStatisticsData.class)
.child(FlowCapableNodeConnectorStatistics.class);
verify(deviceContext).writeToTransaction(
- Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.eq(portPath),
- Matchers.any(FlowCapableNodeConnectorStatistics.class));
+ eq(LogicalDatastoreType.OPERATIONAL),
+ eq(portPath),
+ any(FlowCapableNodeConnectorStatistics.class));
}
@Test
.augmentation(FlowTableStatisticsData.class)
.child(FlowTableStatistics.class);
verify(deviceContext).writeToTransaction(
- Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.eq(tablePath),
- Matchers.any(FlowTableStatistics.class));
+ eq(LogicalDatastoreType.OPERATIONAL),
+ eq(tablePath),
+ any(FlowTableStatistics.class));
}
@Test
.augmentation(FlowCapableNodeConnector.class)
.child(Queue.class, new QueueKey(new QueueId(queueIdValue)));
verify(deviceContext).writeToTransaction(
- Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.eq(queuePath),
- Matchers.any(Queue.class));
+ eq(LogicalDatastoreType.OPERATIONAL),
+ eq(queuePath),
+ any(Queue.class));
}
@Test
.child(Table.class, new TableKey((short) 0));
final KeyedInstanceIdentifier<Flow, FlowKey> flowPath = tablePath.child(Flow.class, new FlowKey(flowId));
- verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.<InstanceIdentifier<?>>any());
+ verify(deviceContext, Mockito.never()).addDeleteToTxChain(eq(LogicalDatastoreType.OPERATIONAL),
+ ArgumentMatchers.<InstanceIdentifier<?>>any());
final InOrder inOrder = Mockito.inOrder(deviceContext);
- inOrder.verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.any(),
- Matchers.any());
+ inOrder.verify(deviceContext).writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
+ any(),
+ any());
}
@Test
new org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId(meterIdValue);
final KeyedInstanceIdentifier<Meter, MeterKey> meterPath = dummyNodePath.augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(meterId));
- verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.<InstanceIdentifier<?>>any());
+ verify(deviceContext, Mockito.never()).addDeleteToTxChain(eq(LogicalDatastoreType.OPERATIONAL),
+ ArgumentMatchers.<InstanceIdentifier<?>>any());
verify(deviceMeterRegistry).store(meterId);
- verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
- Matchers.eq(meterPath), Matchers.any(Meter.class));
+ verify(deviceContext).writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
+ eq(meterPath), any(Meter.class));
}
private void fireAndCheck(final MultipartType type, final List<MultipartReply> statsData)
throws InterruptedException, ExecutionException, TimeoutException {
- when(statisticsService.getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.eq(type)))
+ when(statisticsService.getStatisticsOfType(any(EventIdentifier.class),eq(type)))
.thenReturn(Futures.immediateFuture(RpcResultBuilder.success(statsData).build()));
final ListenableFuture<Boolean> gatherStatisticsResult = StatisticsGatheringUtils.gatherStatistics(
verify(deviceContext).isTransactionsEnabled();
verify(deviceContext).getReadTransaction();
- verify(deviceContext).writeToTransaction(Mockito.eq(LogicalDatastoreType.OPERATIONAL),
- Mockito.any(),
- Mockito.any());
+ verify(deviceContext).writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL), any(), any());
}
}
package org.opendaylight.openflowplugin.impl.statistics;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.lang.reflect.Field;
-import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
-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.lifecycle.ReconciliationFrameworkRegistrar;
import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
-import org.opendaylight.openflowplugin.impl.registry.flow.DeviceFlowRegistryImpl;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
.create(Nodes.class)
.child(Node.class, new NodeKey(new NodeId("openflow:10")));
- when(mockedPrimConnectionContext.getFeatures()).thenReturn(mockedFeatures);
- when(mockedPrimConnectionContext.getConnectionAdapter()).thenReturn(mockedConnectionAdapter);
- when(mockedPrimConnectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
- when(mockedPrimConnectionContext.getNodeId()).thenReturn(NODE_ID);
- when(mockedPrimConnectionContext.getOutboundQueueProvider()).thenReturn(outboundQueue);
-
- when(mockedDeviceState.isFlowStatisticsAvailable()).thenReturn(Boolean.TRUE);
- when(mockedDeviceState.isGroupAvailable()).thenReturn(Boolean.TRUE);
- when(mockedDeviceState.isMetersAvailable()).thenReturn(Boolean.TRUE);
- when(mockedDeviceState.isPortStatisticsAvailable()).thenReturn(Boolean.TRUE);
- when(mockedDeviceState.isQueueStatisticsAvailable()).thenReturn(Boolean.TRUE);
- when(mockedDeviceState.isTableStatisticsAvailable()).thenReturn(Boolean.TRUE);
- when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(nodePath);
- when(mockedDeviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
- when(mockedDeviceInfo.getNodeId()).thenReturn(NODE_ID);
-
- when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
- when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
- when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessagSpy);
- when(mockedDeviceContext.getDeviceFlowRegistry())
- .thenReturn(new DeviceFlowRegistryImpl(OFConstants.OFP_VERSION_1_3, dataBroker, nodePath));
- when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
- when(mockedDeviceContext.getMultiMsgCollector(
- Matchers.<RequestContext<List<MultipartReply>>>any())).thenAnswer(
- invocation -> {
- currentRequestContext = (RequestContext<List<MultipartReply>>) invocation.getArguments()[0];
- return multiMagCollector;
- });
when(rpcProviderRegistry.addRpcImplementation(
- Matchers.eq(StatisticsManagerControlService.class),
- Matchers.<StatisticsManagerControlService>any())).thenReturn(serviceControlRegistration);
+ eq(StatisticsManagerControlService.class),
+ ArgumentMatchers.<StatisticsManagerControlService>any())).thenReturn(serviceControlRegistration);
final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
final long basicTimerDelay = 3000L;
package org.opendaylight.openflowplugin.impl.statistics.services;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
-import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
import org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext;
import org.opendaylight.yangtools.yang.common.RpcResult;
Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(null);
- Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector)
- .endCollecting(Matchers.any(EventIdentifier.class));
}
}
package org.opendaylight.openflowplugin.impl.statistics.services;
+import static org.mockito.ArgumentMatchers.any;
+
import com.google.common.util.concurrent.FutureCallback;
import java.math.BigInteger;
import org.junit.Before;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void init() throws Exception {
- Mockito.when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
+ Mockito.lenient().when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
Mockito.when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
- Mockito.when(deviceContext.getMultiMsgCollector(Matchers.any(RequestContext.class)))
+ Mockito.lenient().when(deviceContext.getMultiMsgCollector(any(RequestContext.class)))
.thenReturn(multiMsgCollector);
- Mockito.when(deviceContext.oook()).thenReturn(translatorLibrary);
- Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
+ Mockito.lenient().when(deviceContext.oook()).thenReturn(translatorLibrary);
+ Mockito.lenient().when(deviceContext.getDeviceState()).thenReturn(deviceState);
Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
- Mockito.when(deviceInfo.getNodeId()).thenReturn(NODE_ID);
- Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
- Mockito.when(deviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
- Mockito.when(connectionContext.getFeatures()).thenReturn(features);
- Mockito.when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
- Mockito.when(features.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
- Mockito.when(getFeaturesOutput.getDatapathId()).thenReturn(BigInteger.valueOf(123L));
- Mockito.when(getFeaturesOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+ Mockito.lenient().when(deviceInfo.getNodeId()).thenReturn(NODE_ID);
+ Mockito.lenient().when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+ Mockito.lenient().when(deviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
+ Mockito.lenient().when(connectionContext.getFeatures()).thenReturn(features);
+ Mockito.lenient().when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
+ Mockito.lenient().when(features.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+ Mockito.lenient().when(getFeaturesOutput.getDatapathId()).thenReturn(BigInteger.valueOf(123L));
+ Mockito.lenient().when(getFeaturesOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
setUp();
}
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
-import org.mockito.Mockito;
import org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
//NOOP
}
};
- Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
+ //Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
}
@Test(expected = IllegalAccessError.class)
package org.opendaylight.openflowplugin.impl.statistics.services;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.ArgumentMatchers.same;
+
import com.google.common.util.concurrent.FutureCallback;
import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
};
Mockito.when(rqContextStack.<List<MultipartReply>>createRequestContext()).thenReturn(rqContextMp);
Mockito.when(translatorLibrary
- .<MultipartReply, AggregatedFlowStatistics>lookupTranslator(Matchers.any(TranslatorKey.class)))
+ .<MultipartReply, AggregatedFlowStatistics>lookupTranslator(Mockito.<TranslatorKey>any()))
.thenReturn(translator);
}
@Test
public void testGetAggregateFlowStatisticsFromFlowTableForGivenMatch() throws Exception {
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), Mockito.<FutureCallback>any());
Mockito.doAnswer((Answer<Void>) invocation -> {
final MultipartReplyMessageBuilder messageBuilder = new MultipartReplyMessageBuilder()
.setVersion(OFConstants.OFP_VERSION_1_3);
.success(Collections.<MultipartReply>singletonList(messageBuilder.build()))
.build());
return null;
- }).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
+ }).when(multiMsgCollector).endCollecting(Mockito.<EventIdentifier>any());
Mockito.when(translator.translate(
- Matchers.any(MultipartReply.class), Matchers.same(deviceInfo), Matchers.isNull())
+ Mockito.<MultipartReply>any(), same(deviceInfo), isNull())
).thenReturn(new AggregatedFlowStatisticsBuilder().build());
GetAggregateFlowStatisticsFromFlowTableForGivenMatchInputBuilder input =
package org.opendaylight.openflowplugin.impl.statistics.services;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import com.google.common.util.concurrent.FutureCallback;
import java.math.BigInteger;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
@Test
public void testGetFlowTablesStatistics() throws Exception {
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
GetFlowTablesStatisticsInputBuilder input = new GetFlowTablesStatisticsInputBuilder()
.setNode(createNodeRef("unitProt:123"));
Assert.assertTrue(rpcResult.isSuccessful());
Assert.assertEquals(MultipartType.OFPMPTABLE, requestInput.getValue().getType());
- Mockito.verify(notificationPublishService).offerNotification(Matchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
}
@Test
package org.opendaylight.openflowplugin.impl.statistics.services;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import com.google.common.util.concurrent.FutureCallback;
import java.math.BigInteger;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
new AtomicLong(), notificationPublishService, convertorManager);
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
}
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(Matchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
}
@Test
package org.opendaylight.openflowplugin.impl.statistics.services;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import com.google.common.util.concurrent.FutureCallback;
import java.math.BigInteger;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
new AtomicLong(), notificationPublishService, convertorManager);
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
}
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(Matchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
}
@Test
package org.opendaylight.openflowplugin.impl.statistics.services;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import com.google.common.util.concurrent.FutureCallback;
import java.math.BigInteger;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
new AtomicLong(), notificationPublishService);
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
}
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(Matchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
}
@Test
package org.opendaylight.openflowplugin.impl.statistics.services;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import com.google.common.util.concurrent.FutureCallback;
import java.math.BigInteger;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId;
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(Matchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
}
@Test
public void testGetAllQueuesStatisticsFromAllPorts() throws Exception {
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
GetAllQueuesStatisticsFromAllPortsInputBuilder input = new GetAllQueuesStatisticsFromAllPortsInputBuilder()
.setNode(createNodeRef("unitProt:123"));
@Test
public void testGetAllQueuesStatisticsFromGivenPort() throws Exception {
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
GetAllQueuesStatisticsFromGivenPortInputBuilder input = new GetAllQueuesStatisticsFromGivenPortInputBuilder()
.setNode(createNodeRef("unitProt:123"))
@Test
public void testGetQueueStatisticsFromGivenPort() throws Exception {
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
GetQueueStatisticsFromGivenPortInputBuilder input = new GetQueueStatisticsFromGivenPortInputBuilder()
.setNode(createNodeRef("unitProt:123"))
package org.opendaylight.openflowplugin.impl.statistics.services.compatibility;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.ListenableFuture;
import java.math.BigInteger;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
return null;
};
- Mockito.when(featuresOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+ Mockito.lenient().when(featuresOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
- Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
+ Mockito.lenient().when(deviceContext.getDeviceState()).thenReturn(deviceState);
Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
Mockito.when(deviceInfo.getNodeId()).thenReturn(NODE_ID);
Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(null);
- Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector)
- .endCollecting(Matchers.any(EventIdentifier.class));
+ Mockito.lenient().doAnswer(closeRequestFutureAnswer).when(multiMsgCollector)
+ .endCollecting(any(EventIdentifier.class));
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
- Mockito.when(translatorLibrary.lookupTranslator(Matchers.any(TranslatorKey.class))).thenReturn(translator);
+ Mockito.when(translatorLibrary.lookupTranslator(any(TranslatorKey.class))).thenReturn(translator);
service = AggregateFlowsInTableService.createWithOook(rqContextStack, deviceContext, new AtomicLong(20L));
}
.setFlowCount(new Counter32(12L))
.setPacketCount(new Counter64(BigInteger.valueOf(13L)))
.build();
- Mockito.when(translator.translate(Matchers.any(MultipartReply.class), Matchers.eq(deviceInfo), Matchers.any()))
+ Mockito.when(translator.translate(any(MultipartReply.class), eq(deviceInfo), any()))
.thenReturn(aggregatedStats);
Assert.assertTrue(result.isSuccessful());
Assert.assertEquals(MultipartType.OFPMPAGGREGATE, requestInput.getValue().getType());
Mockito.verify(notificationPublishService, Mockito.timeout(500))
- .offerNotification(Matchers.any(AggregateFlowStatisticsUpdate.class));
+ .offerNotification(any(AggregateFlowStatisticsUpdate.class));
}
}
package org.opendaylight.openflowplugin.impl.statistics.services.compatibility;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+
import com.google.common.util.concurrent.FutureCallback;
import java.math.BigInteger;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.OFConstants;
rqContextStack, deviceContext, notificationPublishService, new AtomicLong(21), convertorManager);
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
- .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
- Mockito.when(translatorLibrary.lookupTranslator(Matchers.<TranslatorKey>any())).thenReturn(translator);
+ .commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
+ Mockito.when(translatorLibrary.lookupTranslator(ArgumentMatchers.<TranslatorKey>any())).thenReturn(translator);
}
@Test(expected = IllegalAccessError.class)
.setNode(createNodeRef("unitProt:123"))
.setTableId(new TableId((short) 1));
- Mockito.when(translator.translate(Matchers.any(MultipartReply.class), Matchers.eq(deviceInfo), Matchers.any()))
+ Mockito.when(translator.translate(any(MultipartReply.class), eq(deviceInfo),any()))
.thenReturn(new AggregatedFlowStatisticsBuilder()
.setByteCount(new Counter64(BigInteger.valueOf(50L)))
.setPacketCount(new Counter64(BigInteger.valueOf(51L)))
Assert.assertEquals(MultipartType.OFPMPAGGREGATE, requestInput.getValue().getType());
Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
- .offerNotification(Matchers.any(Notification.class));
+ .offerNotification(any(Notification.class));
}
@Test
Assert.assertEquals(MultipartType.OFPMPFLOW, requestInput.getValue().getType());
Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
- .offerNotification(Matchers.any(Notification.class));
+ .offerNotification(any(Notification.class));
}
private static RpcResult<Object> buildFlowStatsReply() {
Assert.assertEquals(MultipartType.OFPMPFLOW, requestInput.getValue().getType());
Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
- .offerNotification(Matchers.any(Notification.class));
+ .offerNotification(any(Notification.class));
}
@Test
Assert.assertEquals(MultipartType.OFPMPFLOW, requestInput.getValue().getType());
Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
- .offerNotification(Matchers.any(Notification.class));
+ .offerNotification(any(Notification.class));
}
}
convertorManager,
MultipartWriterProviderFactory
.createDefaultProvider(mockedDeviceContext));
- Mockito.doReturn(NODE_ID).when(mockedPrimConnectionContext).getNodeId();
Mockito.when(mockedDeviceInfo.getNodeId()).thenReturn(NODE_ID);
Mockito.when(mockedDeviceContext.getDeviceInfo().getNodeId()).thenReturn(NODE_ID);
}
package org.opendaylight.openflowplugin.impl.statistics.services.direct;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when;
import java.math.BigInteger;
.child(Node.class, new NodeKey(new NodeId(NODE_ID)));
convertorManager = ConvertorManagerFactory.createDefaultManager();
- when(deviceContext.getDeviceFlowRegistry()).thenReturn(deviceFlowRegistry);
- when(deviceContext.getDeviceGroupRegistry()).thenReturn(deviceGroupRegistry);
- when(deviceContext.getDeviceMeterRegistry()).thenReturn(deviceMeterRegistry);
+ lenient().when(deviceContext.getDeviceFlowRegistry()).thenReturn(deviceFlowRegistry);
+ lenient().when(deviceContext.getDeviceGroupRegistry()).thenReturn(deviceGroupRegistry);
+ lenient().when(deviceContext.getDeviceMeterRegistry()).thenReturn(deviceMeterRegistry);
when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
- when(deviceContext.getMultiMsgCollector(any())).thenReturn(multiMsgCollector);
- when(deviceContext.oook()).thenReturn(translatorLibrary);
- when(deviceContext.getDeviceState()).thenReturn(deviceState);
+ lenient().when(deviceContext.getMultiMsgCollector(any())).thenReturn(multiMsgCollector);
+ lenient().when(deviceContext.oook()).thenReturn(translatorLibrary);
+ lenient().when(deviceContext.getDeviceState()).thenReturn(deviceState);
when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
- when(deviceInfo.getNodeId()).thenReturn(new NodeId(NODE_ID));
+ lenient().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);
+ lenient().when(getFeaturesOutput.getVersion()).thenReturn(OF_VERSION);
+ lenient().when(getFeaturesOutput.getDatapathId()).thenReturn(DATAPATH_ID);
when(connectionContext.getFeatures()).thenReturn(features);
- when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
- when(features.getVersion()).thenReturn(OF_VERSION);
- when(features.getDatapathId()).thenReturn(DATAPATH_ID);
+ lenient().when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
+ lenient().when(features.getVersion()).thenReturn(OF_VERSION);
+ lenient().when(features.getDatapathId()).thenReturn(DATAPATH_ID);
multipartWriterProvider = MultipartWriterProviderFactory.createDefaultProvider(deviceContext);
setUp();
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetFlowStatisticsInput input = mock(GetFlowStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getTableId()).thenReturn(TABLE_NO);
final MultipartRequestFlowCase body = (MultipartRequestFlowCase) ((MultipartRequestInput) service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetGroupStatisticsInput input = mock(GetGroupStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
+ lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getGroupId()).thenReturn(new GroupId(GROUP_NO));
final MultipartRequestGroupCase body = (MultipartRequestGroupCase) ((MultipartRequestInput) service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetMeterStatisticsInput input = mock(GetMeterStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getMeterId()).thenReturn(new MeterId(METER_NO));
final MultipartRequestMeterCase body = (MultipartRequestMeterCase) ((MultipartRequestInput) service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetNodeConnectorStatisticsInput input = mock(GetNodeConnectorStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
+ lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getNodeConnectorId()).thenReturn(nodeConnectorId);
final MultipartRequestPortStatsCase body = (MultipartRequestPortStatsCase) ((MultipartRequestInput)service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetQueueStatisticsInput input = mock(GetQueueStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
+ lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(input.getNodeConnectorId()).thenReturn(new NodeConnectorId(NODE_ID + ":" + PORT_NO));
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetFlowStatisticsInput input = mock(GetFlowStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getTableId()).thenReturn(TABLE_NO);
final MultipartRequestFlowStats body = (MultipartRequestFlowStats) ((MultipartRequest) service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetGroupStatisticsInput input = mock(GetGroupStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
+ lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getGroupId()).thenReturn(new GroupId(GROUP_NO));
final MultipartRequestGroupStats body = (MultipartRequestGroupStats) ((MultipartRequest) service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetMeterStatisticsInput input = mock(GetMeterStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
+ lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getMeterId()).thenReturn(new MeterId(METER_NO));
final MultipartRequestMeterStats body = (MultipartRequestMeterStats) ((MultipartRequest) service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetNodeConnectorStatisticsInput input = mock(GetNodeConnectorStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
+ lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getNodeConnectorId()).thenReturn(nodeConnectorId);
final MultipartRequestPortStats body = (MultipartRequestPortStats) ((MultipartRequest)service
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public void testBuildRequestBody() throws Exception {
final GetQueueStatisticsInput input = mock(GetQueueStatisticsInput.class);
- when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
+ lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(input.getNodeConnectorId()).thenReturn(nodeConnectorId);
translator = new FlowRemovedTranslator(convertorManager);
translatorV10 = new FlowRemovedV10Translator(convertorManager);
- when(deviceContext.getDeviceState()).thenReturn(deviceState);
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeId);
- when(features.getDatapathId()).thenReturn(BigInteger.TEN);
}
@Test
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
final List<PhyPort> phyPorts = Collections.singletonList(phyPort);
convertorManager = ConvertorManagerFactory.createDefaultManager();
- Mockito.when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
- Mockito.when(connectionContext.getFeatures()).thenReturn(featuresReply);
- Mockito.when(featuresReply.getDatapathId()).thenReturn(BigInteger.TEN);
- Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
- Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
Mockito.when(deviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
- Mockito.when(getFeaturesOutput.getDatapathId()).thenReturn(BigInteger.TEN);
- Mockito.when(getFeaturesOutput.getPhyPort()).thenReturn(phyPorts);
- Mockito.when(phyPort.getPortNo()).thenReturn(PORT_NO_DS);
}
@Test
.child(Node.class, new NodeKey(new NodeId("openflow:10")));
final PacketReceivedTranslator packetReceivedTranslator = new PacketReceivedTranslator(convertorManager);
final PacketInMessage packetInMessage = createPacketInMessage(DATA.getBytes(), PORT_NO);
- Mockito.when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodePath);
final PacketReceived packetReceived = packetReceivedTranslator.translate(packetInMessage, deviceInfo, null);
Assert.assertEquals("org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController",
packetReceived.getPacketInReason().getName());
Assert.assertEquals("openflow:10:" + PORT_NO,
- packetReceived.getIngress().getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class)
- .getId().getValue());
+ packetReceived.getIngress().getValue().firstKeyOf(NodeConnector.class).getId().getValue());
Assert.assertEquals(0L, packetReceived.getFlowCookie().getValue().longValue());
Assert.assertEquals(42L, packetReceived.getTableId().getValue().longValue());
}
@Before
public void setUp() throws Exception {
- Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
portUpdateTranslator = new PortUpdateTranslator();
portStateBld = new StateBuilder().setLive(true);
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatchers;
import org.mockito.Captor;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@Before
public void setUp() throws Exception {
- Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
+ Mockito.when(transactionService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
final ListenableFuture<RpcResult<String>> chainResult =
BarrierUtil.chainBarrier(input, NODE_REF, transactionService, compositeTransform);
- Mockito.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+ Mockito.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
Mockito.verify(compositeTransform).apply(pairCpt.capture());
final Pair<RpcResult<String>, RpcResult<SendBarrierOutput>> value = pairCpt.getValue();
package org.opendaylight.openflowplugin.impl.util;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package org.opendaylight.openflowplugin.impl.util;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
@Before
public void setUp() throws Exception {
convertorManager = ConvertorManagerFactory.createDefaultManager();
- when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeatures);
- when(mockedFeatures.getDatapathId()).thenReturn(mockedDataPathId);
when(mockedDeviceInfo.getDatapathId()).thenReturn(mockedDataPathId);
when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedConnectionContext);
}
extensionConverterProvider,
convertorManager);
verify(mockedRpcContext, times(NUMBER_OF_RPC_SERVICE_REGISTRATION)).registerRpcServiceImplementation(
- Matchers.any(), any(RpcService.class));
+ any(), any(RpcService.class));
}
@Test
notificationPublishService,
convertorManager);
verify(mockedRpcContext, times(NUMBER_OF_STAT_COMPAT_RPC_SERVICE_REGISTRATION))
- .registerRpcServiceImplementation(Matchers.any(), any(RpcService.class));
+ .registerRpcServiceImplementation(any(), any(RpcService.class));
}
}
\ No newline at end of file
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
</goals>
</pluginExecutionFilter>
<action>
- <ignore />
+ <ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</dependencies>
</project>
-
getBandsFromSAL(source.getMeterBandHeaders(), bands);
meterModInputBuilder.setBands(bands);
} else {
- LOG.error("For this meter Id" + source.getMeterId().getValue() + ",no associated band data found!");
+ LOG.error("For this meter Id {}, no associated band data found!", source.getMeterId().getValue());
}
meterModInputBuilder.setVersion(data.getVersion());
if (actionExecutor != null) {
actionExecutor.execute(property, propBuilder);
} else {
- LOG.error("Unsupported table feature property : " + propType);
+ LOG.error("Unsupported table feature property : {}", propType);
}
propBuilder.setOrder(index);
if (convertedAction.isPresent()) {
result.add(convertedAction.get());
} else {
- /**
+ /*
* TODO: EXTENSION PROPOSAL (action, OFJava to MD-SAL)
* - we might also need a way on how to identify exact type of augmentation to be
* used as match can be bound to multiple models
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import org.junit.Before;
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.14.0-SNAPSHOT</version>
+ <version>3.0.1</version>
<relativePath/>
</parent>
</dependency>
</dependencies>
</project>
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
MatchBuilder match = new MatchBuilder();
match.setEthernetMatch(ethernetMatch);
- Uri outputPort = dstPort.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId();
+ Uri outputPort = dstPort.getValue().firstKeyOf(NodeConnector.class).getId();
Action outputToControllerAction = new ActionBuilder()
.setOrder(0)
* @param tablePath the table path
*/
public static Short getTableId(final InstanceIdentifier<Table> tablePath) {
- return tablePath.firstKeyOf(Table.class, TableKey.class).getId();
+ return tablePath.firstKeyOf(Table.class).getId();
}
/**
* Extracts NodeConnectorKey from node connector path.
*/
public static NodeConnectorKey getNodeConnectorKey(final InstanceIdentifier<?> nodeConnectorPath) {
- return nodeConnectorPath.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
+ return nodeConnectorPath.firstKeyOf(NodeConnector.class);
}
public static InstanceIdentifier<NodeConnector> createNodeConnectorPath(final InstanceIdentifier<Node> nodeKey,
tablePath = appearedTablePath;
nodePath = tablePath.firstIdentifierOf(Node.class);
- nodeId = nodePath.firstKeyOf(Node.class, NodeKey.class).getId();
+ nodeId = nodePath.firstKeyOf(Node.class).getId();
mac2portMapping = new HashMap<>();
// start forwarding all packages to controller
String macPath = srcMac.toString() + dstMac.toString();
if (!coveredMacPaths.contains(macPath)) {
LOG.debug("covering mac path: {} by [{}]", macPath,
- destNodeConnector.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId());
+ destNodeConnector.getValue().firstKeyOf(NodeConnector.class).getId());
coveredMacPaths.add(macPath);
FlowId flowId = new FlowId(String.valueOf(flowIdInc.getAndIncrement()));
}
private NodeConnectorId nodeConnectorId(String connectorId) {
- NodeKey nodeKey = nodePath.firstKeyOf(Node.class, NodeKey.class);
+ NodeKey nodeKey = nodePath.firstKeyOf(Node.class);
StringBuilder stringId = new StringBuilder(nodeKey.getId().getValue()).append(":").append(connectorId);
return new NodeConnectorId(stringId.toString());
}
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
~ and is available at http://www.eclipse.org/legal/epl-v10.html
-->
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
</dependency>
</dependencies>
</project>
-
</dependency>
</dependencies>
</project>
-
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
}
}
} catch (RuntimeException ex) {
- LOG.error(ex.getMessage(), ex);
+ LOG.error("Error {}", ex);
return false;
}
if (scenarioHandler.isFinishedOK()) {
}
}
} catch (InterruptedException ex) {
- LOG.error(ex.getMessage(), ex);
+ LOG.error("Error {}", ex);
} finally {
LOG.debug("listening client shutting down");
try {
bossGroup.shutdownGracefully().get();
LOG.debug("listening client shutdown succesful");
} catch (InterruptedException | ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error {}", e);
}
}
scenarioDone.set(true);
WaitForMessageEvent event = (WaitForMessageEvent) peek;
event.setHeaderReceived(ofMsg.poll(2000, TimeUnit.MILLISECONDS));
} catch (InterruptedException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error {}", e);
break;
}
} else if (peek instanceof SendEvent) {
}
if (freezeCounter > freeze) {
LOG.warn("Scenario frozen: {}", freezeCounter);
- LOG.warn("Scenario step not finished NOT OK!", freezeCounter);
+ LOG.warn("Scenario step not finished NOT OK! {}", freezeCounter);
this.finishedOK = false;
break;
}
try {
sleep(sleepBetweenTries);
} catch (InterruptedException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error {}", e);
}
}
LOG.debug("Scenario finished");
ctx.writeAndFlush(buffer);
if (LOG.isDebugEnabled()) {
- LOG.debug(">> {}", ByteBufUtils.bytesToHexString(msgToSend));
+ LOG.debug("Message to send {}", ByteBufUtils.bytesToHexString(msgToSend));
LOG.debug("message sent");
}
return true;
}
}
} catch (InterruptedException ex) {
- LOG.error(ex.getMessage(), ex);
+ LOG.error("Error {}", ex);
} finally {
LOG.debug("shutting down");
try {
group.shutdownGracefully().get();
LOG.debug("shutdown succesful");
} catch (InterruptedException | ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error {}", e);
}
}
scenarioDone.set(true);
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ByteBuf bb = (ByteBuf) msg;
if (LOG.isDebugEnabled()) {
- LOG.debug("<< {}", ByteBufUtils.byteBufToHexString(bb));
+ LOG.debug("Message {}", ByteBufUtils.byteBufToHexString(bb));
}
int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
LOG.trace("SimpleClientHandler - start of read");
LOG.debug("Sleeping");
return true;
} catch (InterruptedException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error {}", e);
}
return false;
}
}
}
} catch (InterruptedException ex) {
- LOG.error(ex.getMessage(), ex);
+ LOG.error("Error {}", ex);
} finally {
LOG.debug("shutting down");
try {
group.shutdownGracefully().get();
LOG.debug("shutdown succesful");
} catch (InterruptedException | ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error {}", e);
}
}
scenarioDone.set(true);
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.openflowplugin</groupId>
} catch (RejectedExecutionException e) {
incrementRunableRejected();
}
- LOG.debug("onPacketReceived - Leaving", notification);
+ LOG.debug("onPacketReceived - {} Leaving", notification);
}
private static final Instructions DROP_INSTRUCTIONS = makeStaticDropActionInstructions();
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@Override
public void onFlowAdded(FlowAdded notification) {
- LOG.info("flow to be added.........................." + notification.toString());
- LOG.info("added flow Xid........................." + notification.getTransactionId().getValue());
- LOG.info("-----------------------------------------------------------------------------------");
+ LOG.info("flow to be added {}", notification.toString());
+ LOG.info("added flow Xid {}", notification.getTransactionId().getValue());
}
@Override
public void onFlowRemoved(FlowRemoved notification) {
- LOG.debug("removed flow.........................." + notification.toString());
- LOG.debug("remove flow Xid........................." + notification.getTransactionId().getValue());
- LOG.debug("-----------------------------------------------------------------------------------");
+ LOG.debug("removed flow {}", notification.toString());
+ LOG.debug("remove flow Xid {}", notification.getTransactionId().getValue());
}
@Override
public void onFlowUpdated(FlowUpdated notification) {
- LOG.debug("updated flow.........................." + notification.toString());
- LOG.debug("updated flow Xid........................." + notification.getTransactionId().getValue());
- LOG.debug("-----------------------------------------------------------------------------------");
+ LOG.debug("updated flow {}", notification.toString());
+ LOG.debug("updated flow Xid {}", notification.getTransactionId().getValue());
}
@Override
@Override
public void onSwitchFlowRemoved(SwitchFlowRemoved notification) {
- LOG.debug("Switch flow removed : Cookies..................."
- + notification.getCookie().toString());
- LOG.debug("-----------------------------------------------------------------------------------");
+ LOG.debug("Switch flow removed : Cookies {}", notification.getCookie().toString());
}
}
@Override
public void onBadActionErrorNotification(BadActionErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onBadInstructionErrorNotification(BadInstructionErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onBadMatchErrorNotification(BadMatchErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onBadRequestErrorNotification(BadRequestErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onExperimenterErrorNotification(ExperimenterErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onFlowModErrorNotification(FlowModErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onGroupModErrorNotification(GroupModErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onHelloFailedErrorNotification(HelloFailedErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onMeterModErrorNotification(MeterModErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onPortModErrorNotification(PortModErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onQueueOpErrorNotification(QueueOpErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onRoleRequestErrorNotification(RoleRequestErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onSwitchConfigErrorNotification(SwitchConfigErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onTableFeaturesErrorNotification(TableFeaturesErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
@Override
public void onTableModErrorNotification(TableModErrorNotification notification) {
- LOG.error("Error notification ----"
- + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
+ LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
+ notification.getTransactionId().getValue()));
}
private String toStr(ErrorType type, int code, BigInteger xid) {
@Override
public void onFailure(Throwable throwable) {
- LOG.error(throwable.getMessage(), throwable);
+ LOG.error("Status of Group Data Loaded Transaction : failure. Reason : {}", throwable);
ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
}
}, MoreExecutors.directExecutor());
@Override
public void onFailure(Throwable throwable) {
- LOG.error(throwable.getMessage(), throwable);
+ LOG.error("Status of Group Data Loaded Transaction : failure. Reason : {}", throwable);
ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
}
}, MoreExecutors.directExecutor());
*/
@Override
public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
- String plus = "addGroup - " + input;
- OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+ OpenflowpluginGroupTestServiceProvider.LOG.info("addGroup - {}", input);
return null;
}
@Override
public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(
RemoveGroupInput input) {
- String plus = "removeGroup - " + input;
- OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+ OpenflowpluginGroupTestServiceProvider.LOG.info("removeGroup - {}", input);
return null;
}
@Override
public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(
UpdateGroupInput input) {
- String plus = "updateGroup - " + input;
- OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+ OpenflowpluginGroupTestServiceProvider.LOG.info("updateGroup - {}", input);
return null;
}
@Override
public void onMeterAdded(MeterAdded notification) {
- LOG.info("Meter to be added.........................." + notification.toString());
- LOG.info("Meter Xid........................." + notification.getTransactionId().getValue());
- LOG.info("-----------------------------------------------------------------------------------");
+ LOG.info("Meter to be added {}", notification.toString());
+ LOG.info("Meter Xid {}", notification.getTransactionId().getValue());
}
@Override
public void onMeterRemoved(MeterRemoved notification) {
- LOG.info("Meter to be removed.........................." + notification.toString());
- LOG.info("Meter Xid........................." + notification.getTransactionId().getValue());
- LOG.info("-----------------------------------------------------------------------------------");
+ LOG.info("Meter to be removed {}", notification.toString());
+ LOG.info("Meter Xid {}", notification.getTransactionId().getValue());
}
@Override
public void onMeterUpdated(MeterUpdated notification) {
- LOG.info("Meter to be updated.........................." + notification.toString());
- LOG.info("Meter Xid........................." + notification.getTransactionId().getValue());
- LOG.info("-----------------------------------------------------------------------------------");
+ LOG.info("Meter to be updated {}", notification.toString());
+ LOG.info("Meter Xid {}", notification.getTransactionId().getValue());
}
}
*/
@Override
public ListenableFuture<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
- String plus = "addMeter - " + input;
- OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+ OpenflowpluginMeterTestServiceProvider.LOG.info("addMeter - {}", input);
return null;
}
@Override
public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(
final RemoveMeterInput input) {
- String plus = "removeMeter - " + input;
- OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+ OpenflowpluginMeterTestServiceProvider.LOG.info("removeMeter - {}", input);
return null;
}
@Override
public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(
final UpdateMeterInput input) {
- String plus = "updateMeter - " + input;
- OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+ OpenflowpluginMeterTestServiceProvider.LOG.info("updateMeter - {}", input);
return null;
}
@Override
public ListenableFuture<RpcResult<UpdateTableOutput>> updateTable(
UpdateTableInput input) {
- String plus = "updateTable - " + input;
- OpenflowpluginTableFeaturesTestServiceProvider.LOG.info(plus);
+ OpenflowpluginTableFeaturesTestServiceProvider.LOG.info("updateTable - {}", input);
return null;
}
@Override
public void onFailure(final Throwable throwable) {
- LOG.error(throwable.getMessage(), throwable);
+ LOG.error("Status of Group Data Loaded Transaction : failure. Reason : {}", throwable);
ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
}
}, MoreExecutors.directExecutor());
@Override
public void onFailure(final Throwable throwable) {
- LOG.error(throwable.getMessage(), throwable);
+ LOG.error("Status of Group Data Loaded Transaction : failure. Reason : {}", throwable);
ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
}
}, MoreExecutors.directExecutor());
@Override
public void onNodeConnectorRemoved(NodeConnectorRemoved notification) {
- LOG.debug("NodeConnectorRemoved Notification ...................");
- LOG.debug("NodeConnectorRef " + notification.getNodeConnectorRef());
- LOG.debug("----------------------------------------------------------------------");
+ LOG.debug("NodeConnectorRemoved Notification");
+ LOG.debug("NodeConnectorRef {}", notification.getNodeConnectorRef());
nodeConnectorRemoved.add(notification);
}
@Override
public void onNodeConnectorUpdated(NodeConnectorUpdated notification) {
- LOG.debug("NodeConnectorUpdated Notification...................");
- LOG.debug("NodeConnectorRef " + notification.getNodeConnectorRef());
- LOG.debug("----------------------------------------------------------------------");
+ LOG.debug("NodeConnectorUpdated Notification");
+ LOG.debug("NodeConnectorRef {}", notification.getNodeConnectorRef());
nodeConnectorUpdated.add(notification);
}
@Override
public void onNodeRemoved(NodeRemoved notification) {
- LOG.debug("NodeRemoved Notification ...................");
- LOG.debug("NodeRef " + notification.getNodeRef());
- LOG.debug("----------------------------------------------------------------------");
+ LOG.debug("NodeRemoved Notification");
+ LOG.debug("NodeRef {}", notification.getNodeRef());
nodeRemoved.add(notification);
}
@Override
public void onNodeUpdated(NodeUpdated notification) {
- LOG.debug("NodeUpdated Notification ...................");
- LOG.debug("NodeRef " + notification.getNodeRef());
- LOG.debug("----------------------------------------------------------------------");
+ LOG.debug("NodeUpdated Notification");
+ LOG.debug("NodeRef {}", notification.getNodeRef());
nodeUpdated.add(notification);
}
}
*/
@Override
public ListenableFuture<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
- String plus = "addFlow - " + input;
- OpenflowpluginTestServiceProvider.LOG.info(plus);
+ OpenflowpluginTestServiceProvider.LOG.info("addFlow - {}", input);
return null;
}
*/
@Override
public ListenableFuture<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
- String plus = "removeFlow - " + input;
- OpenflowpluginTestServiceProvider.LOG.info(plus);
+ OpenflowpluginTestServiceProvider.LOG.info("removeFlow - {}", input);
return null;
}
*/
@Override
public ListenableFuture<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
- String plus = "updateFlow - " + input;
- OpenflowpluginTestServiceProvider.LOG.info(plus);
+ OpenflowpluginTestServiceProvider.LOG.info("updateFlow - {}", input);
return null;
}