JSONTokener jt = new JSONTokener(result);
JSONObject json = new JSONObject(jt);
JSONArray subnetConfigs = json.getJSONArray("subnetConfig");
- Assert.assertEquals(subnetConfigs.length(), 0);
+ Assert.assertEquals(subnetConfigs.length(), 1); // should only get the default subnet
// Test GET subnet1 expecting 404
result = getJsonResult(baseURL + "default/subnet/" + name1);
JSONObject node = json.getJSONObject("node");
Assert.assertEquals(node.getString("type"), "STUB");
Assert.assertEquals(node.getString("id"), "51966");
- // test adding same flow again fails due to repeat name..return 409
+ // test adding same flow again succeeds with a change in any field ..return Success
// code
+ fc = "{\"name\":\"test1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"LOOPBACK\"]}";
result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test1", "PUT", fc);
- Assert.assertTrue(result.equals("409"));
+ Assert.assertTrue(result.equals("Success"));
fc = "{\"name\":\"test2\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test2", "PUT", fc);