请帮助我正在尝试获取与 JIRA XRAY 中的执行相关的所有测试
我在下面最后提到的步骤中收到 java.lang.IllegalStateException: Not a JSON Object 错误(element.getAsJsonObject();)
String urlString=baseServerURL+"/rest/raven/latest/api/testexec/"+executionCycleKey+"/test";
System.out.println(urlString);
HttpURLConnection con = getConnection(urlString, "GET");
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer content = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine.toString());
content.append(inputLine);
}
in.close();
con.disconnect();
Gson g = new Gson();
JsonElement element = g.fromJson(content.toString(), JsonElement.class);
JsonObject jsonObj = element.getAsJsonObject();
注意:inputLine 打印为 [{"id":100806,"status":"TODO","key":"ST_MABC-1234","rank":1}]