URL url = createURL("", params);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("content-type", RestConstants.XML_CONTENT_TYPE);
conn.setDoOutput(true);
jobConf.writeXml(conn.getOutputStream());
assertEquals(HttpServletResponse.SC_CREATED, conn.getResponseCode());
JSONObject obj = (JSONObject) JSONValue.parse(new InputStreamReader(conn.getInputStream()));
assertEquals(MockDagEngineService.JOB_ID + wfCount + MockDagEngineService.JOB_ID_END,
obj.get(JsonTags.JOB_ID));
assertFalse(MockDagEngineService.started.get(wfCount));