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}] として出力されます