Fixup Augmentable and Identifiable methods changing
[openflowplugin.git] / applications / forwardingrules-manager / src / test / java / test / mock / util / FRMTest.java
index a81201368da9ae53df291418184165074da8b366..642a247153d696983f64e2f909554e12249cb89a 100644 (file)
@@ -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.<Node>emptyList()).build();
-        InstanceIdentifier<Node> 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<Node> 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.<Flow>emptyList()).build();
+        final Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
         WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
         InstanceIdentifier<Table> 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;
     }
-
 }