ONOS-4505: Bug Fixes

Change-Id: Ia030aa3aff9e2ad34a5e27fbe4ba088dda65bfa7
diff --git a/protocols/isis/ctl/src/test/java/org/onosproject/isis/controller/impl/ControllerTest.java b/protocols/isis/ctl/src/test/java/org/onosproject/isis/controller/impl/ControllerTest.java
index 9a41bd3..13ec2cc 100644
--- a/protocols/isis/ctl/src/test/java/org/onosproject/isis/controller/impl/ControllerTest.java
+++ b/protocols/isis/ctl/src/test/java/org/onosproject/isis/controller/impl/ControllerTest.java
@@ -16,6 +16,8 @@
 
 package org.onosproject.isis.controller.impl;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -30,10 +32,65 @@
 public class ControllerTest {
 
     private Controller controller;
+    private ObjectMapper mapper;
+    private JsonNode jsonNode;
+    private JsonNode jsonNode1;
+    private String jsonString = "{" +
+            "                \"processes\": [{" +
+            "                                \"processId\": \"4.4.4.4\"," +
+            "                                \"interface\": [{" +
+            "                                                \"interfaceIndex\": \"2\"," +
+            "                                                \"macAddress\": \"08:00:27:b7:ab:bf\"," +
+            "                                                \"interfaceIp\": \"192.168.56.101\"," +
+            "                                                \"networkMask\": \"255.255.255.224\"," +
+            "                                                \"intermediateSystemName\": \"ROUTERONE\"," +
+            "                                                \"systemId\": \"2929.2929.2929\"," +
+            "                                                \"lanId\": \"0000.0000.0000.00\"," +
+            "                                                \"idLength\": \"0\"," +
+            "                                                \"maxAreaAddresses\": \"3\"," +
+            "                                                \"reservedPacketCircuitType\": \"1\"," +
+            "                                                \"circuitId\": \"10\"," +
+            "                                                \"networkType\": \"2\"," +
+            "                                                \"areaAddress\": \"490000\"," +
+            "                                                \"areaLength\": \"3\"," +
+            "                                                \"lspId\": \"1313131313130000\"," +
+            "                                                \"holdingTime\": \"50\"," +
+            "                                                \"helloInterval\": \"10\"," +
+            "                                                \"priority\": \"0\"" +
+            "                                }]" +
+            "                }]" +
+            "}";
+    private String jsonString1 = "{" +
+            "                \"processes\": {" +
+            "                                \"interface\": [{" +
+            "                                                \"interfaceIndex\": \"2\"," +
+            "                                                \"interfaceIp\": \"100.100.100.100\"," +
+            "                                                \"macAddress\": \"08:00:27:b7:ab:bf\"," +
+            "                                                \"networkMask\": \"255.255.255.224\"," +
+            "                                                \"intermediateSystemName\": \"ROUTERONE\"," +
+            "                                                \"systemId\": \"2929.2929.2929\"," +
+            "                                                \"lanId\": \"0000.0000.0000.00\"," +
+            "                                                \"idLength\": \"0\"," +
+            "                                                \"maxAreaAddresses\": \"3\"," +
+            "                                                \"reservedPacketCircuitType\": \"1\"," +
+            "                                                \"circuitId\": \"10\"," +
+            "                                                \"networkType\": \"2\"," +
+            "                                                \"areaAddress\": \"490000\"," +
+            "                                                \"areaLength\": \"3\"," +
+            "                                                \"lspId\": \"1313131313130000\"," +
+            "                                                \"holdingTime\": \"50\"," +
+            "                                                \"helloInterval\": \"10\"," +
+            "                                                \"priority\": \"0\"" +
+            "                                }]" +
+            "                }" +
+            "}";
 
     @Before
     public void setUp() throws Exception {
         controller = new Controller();
+        mapper = new ObjectMapper();
+        jsonNode = mapper.readTree(jsonString);
+        jsonNode1 = mapper.readTree(jsonString1);
     }
 
     @After
@@ -58,4 +115,18 @@
         controller.getAllConfiguredProcesses();
         assertThat(controller, is(notNullValue()));
     }
+
+    /**
+     * Tests updateConfig() method.
+     */
+    @Test
+    public void testUpdateConfig() throws Exception {
+        jsonNode.path("interface");
+        controller.updateConfig(jsonNode);
+        assertThat(controller, is(notNullValue()));
+
+        controller.updateConfig(jsonNode1);
+        assertThat(controller, is(notNullValue()));
+    }
+
 }
\ No newline at end of file