Skip to content

Commit

Permalink
Fixed reading Jira XRay response Key when DC solution is used
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisSenicourt committed Oct 6, 2023
1 parent ee61ef4 commit bfcee3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public boolean isTrusted(X509Certificate[] chain, String authType) throws Certif
LOG.debug("XRay Test Execution request http return code : " + rc);
String responseString = EntityUtils.toString(response.getEntity());
LOG.debug("Response : {}", responseString);
JSONObject xRayResponse = new JSONObject(responseString);
JSONObject xRayResponse = getXRayResponseJSON(execution, responseString);
String xrayURL = "";
String xrayTestExecution = "";
if (xRayResponse.has("key")) {
Expand Down Expand Up @@ -315,6 +315,15 @@ public boolean isTrusted(X509Certificate[] chain, String authType) throws Certif

}

private JSONObject getXRayResponseJSON(TestCaseExecution execution, String responseString) throws JSONException {
if (TestCase.TESTCASE_ORIGIN_JIRAXRAYDC.equalsIgnoreCase(execution.getTestCaseObj().getOrigine())) {
return new JSONObject(responseString).getJSONObject("testExecIssue");
}
else {
return new JSONObject(responseString);
}
}

private void getXRayAuthenticationToken(String origin, String system) throws Exception {
String xRayUrl = XRAYCLOUD_AUTHENT_URL;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* Record a file at control level was saving it at action level #2412
* Fixed delete of Campaigns, Services and Users with special Characters #2486
* Fix display of group 2 and 3 on campaign page
* Fix Log Viewer entry when the XRay Key is not provided
* When executing a compaign that has XRay links, fixed an issue where campaign stays PENDING forever in case there is a connectivity issue with JIRA Backend. It now return ERROR with the correct trace message.
* Fixed reading Jira XRay response Key when DC solution is used

*Improvements / New features*
[square]
Expand All @@ -17,7 +18,7 @@
* A pdf report is now available for campaign execution for download #2475
* New action "Switch To Context" #2408
* Added new execution parameter column on campaign list page #2489
* Added new test case 'Verify Text in Element does not contain'
* Added new test case control 'Verify Text in Element does not contain' #2471

*Warning to be considered before applying the version (deprecated features)*
[square]
Expand Down

0 comments on commit bfcee3f

Please sign in to comment.