X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=applications%2Fforwardingrules-manager%2Fsrc%2Ftest%2Fjava%2Ftest%2Fmock%2Futil%2FFRMTest.java;h=642a247153d696983f64e2f909554e12249cb89a;hb=refs%2Fchanges%2F24%2F72524%2F3;hp=a81201368da9ae53df291418184165074da8b366;hpb=436d3b53fa2293b6d11348732db9bcc371e80642;p=openflowplugin.git diff --git a/applications/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java b/applications/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java index a81201368d..642a247153 100644 --- a/applications/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java +++ b/applications/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -33,16 +33,16 @@ public abstract class FRMTest extends AbstractDataBrokerTest { public void addFlowCapableNode(NodeKey nodeKey) { Nodes nodes = new NodesBuilder().setNode(Collections.emptyList()).build(); - InstanceIdentifier flowNodeIdentifier = InstanceIdentifier.create(Nodes.class) - .child(Node.class, nodeKey); FlowCapableNodeBuilder fcnBuilder = new FlowCapableNodeBuilder(); NodeBuilder nodeBuilder = new NodeBuilder(); - nodeBuilder.setKey(nodeKey); + nodeBuilder.withKey(nodeKey); nodeBuilder.addAugmentation(FlowCapableNode.class, fcnBuilder.build()); WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction(); writeTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class), nodes); + + InstanceIdentifier flowNodeIdentifier = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey); writeTx.put(LogicalDatastoreType.OPERATIONAL, flowNodeIdentifier, nodeBuilder.build()); writeTx.put(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Nodes.class), nodes); writeTx.put(LogicalDatastoreType.CONFIGURATION, flowNodeIdentifier, nodeBuilder.build()); @@ -51,13 +51,14 @@ public abstract class FRMTest extends AbstractDataBrokerTest { public void removeNode(NodeKey nodeKey) throws ExecutionException, InterruptedException { WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction(); - writeTx.delete(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey)); + writeTx.delete(LogicalDatastoreType.OPERATIONAL, + InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey)); writeTx.submit().get(); } public void addTable(final TableKey tableKey, final NodeKey nodeKey) { addFlowCapableNode(nodeKey); - final Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.emptyList()).build(); + final Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.emptyList()).build(); WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction(); InstanceIdentifier tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey) .augmentation(FlowCapableNode.class).child(Table.class, tableKey); @@ -78,7 +79,8 @@ public abstract class FRMTest extends AbstractDataBrokerTest { final ConfigurationService configurationService = Mockito.mock(ConfigurationService.class); final ForwardingRulesManagerConfig config = getConfig(); - Mockito.when(configurationService.registerListener(Mockito.any())).thenReturn(() -> {}); + Mockito.when(configurationService.registerListener(Mockito.any())).thenReturn(() -> { + }); Mockito.when(configurationService.getProperty(Mockito.eq("disable-reconciliation"), Mockito.any())) .thenReturn(config.isDisableReconciliation()); @@ -94,5 +96,4 @@ public abstract class FRMTest extends AbstractDataBrokerTest { return configurationService; } - }