Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a3d51ad
DTS-45109: RF and kpi source change
gipathak May 27, 2025
634a8ce
DTS-46624: Rally issue revision history and sprint report implementation
kunkambl May 28, 2025
1cf60bf
Merge branch 'feature/DTS-45109-Rally-Implementation-v1-GP' of https:…
kunkambl May 28, 2025
82c79c1
DTS-46624: removed unwanted comments
kunkambl May 28, 2025
01646b6
DTS-45109: test case fix
gipathak May 28, 2025
c2eb482
DTS-46624: fixed test cases
kunkambl May 28, 2025
8bc9cb4
Merge pull request #35 from PublicisSapient/feature/DTS-46624-rally-s…
kunkambl May 28, 2025
cb903fe
DTS-45109: test case fix
gipathak May 28, 2025
16c2746
DTS-45109: test case fix
gipathak May 28, 2025
f9ea8e1
DTS-45109: test case fix
gipathak May 28, 2025
591f493
DTS-46624: optimized code
kunkambl May 28, 2025
10ac8d1
Merge pull request #36 from PublicisSapient/feature/DTS-46624-rally-s…
kunkambl May 28, 2025
8ef5c58
DTS-45109: test case fix
gipathak May 29, 2025
2530cba
Merge pull request #34 from PublicisSapient/feature/DTS-45109-Rally-I…
gipathak May 29, 2025
d794658
DTS-45109:Quality changes for Rally
gipathak May 29, 2025
b98688b
Merge branch 'develop' of https://github.com/PublicisSapient/knowhow-…
aksshriv1 May 30, 2025
88ea8ed
Quality Explore fix
aksshriv1 May 30, 2025
a6881c7
DTS-45109: Test coverage fix
gipathak May 30, 2025
0f9c00a
Sonar fix
aksshriv1 May 30, 2025
5dff742
Merge branch 'feature/DTS-45109-Rally-Implementation-v1-GP' of https:…
aksshriv1 May 30, 2025
ca2e106
Sonar fix
aksshriv1 May 30, 2025
49c9769
DTS-45109: Added copyright and comments.
gipathak May 30, 2025
d087bb6
Merge branch 'feature/DTS-45109-Rally-Implementation-v1-GP' of https:…
gipathak May 30, 2025
c815c07
Sonar fix
aksshriv1 May 30, 2025
d99f087
Merge branch 'feature/DTS-45109-Rally-Implementation-v1-GP' of https:…
aksshriv1 May 30, 2025
9b80755
Sonar fix
aksshriv1 May 30, 2025
d494b2f
Merge pull request #37 from PublicisSapient/feature/DTS-45109-Rally-I…
gipathak May 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,40 +69,49 @@ public List<ZephyrTestCaseDTO> getTestCase(final int startAt, final ProjectConfF
queryBuilder.append(QUERY_PARAM).append(PROJECT_KEY);
queryBuilder.append(projectConfig.getProjectKey());
queryBuilder.append(INVERTED_COMMA);
if (ObjectUtils.isNotEmpty(projectConfig.getProcessorToolConnection().getProjectComponent())) {
queryBuilder.append(AND);
queryBuilder.append(COMPONENT).append(projectConfig.getProcessorToolConnection().getProjectComponent());
queryBuilder.append(INVERTED_COMMA);
}
buildQuery(projectConfig, queryBuilder);

log.info("ZEPHYR query executed {} ....", queryBuilder);
if (StringUtils.isNotBlank(queryBuilder)) {
ResponseEntity<ZephyrTestCaseDTO[]> response = null;
try {
if (!toolInfo.isBearerToken()) {
response = makeRestCall(queryBuilder.toString(), ZephyrTestCaseDTO[].class, HttpMethod.GET,
zephyrUtil.getCredentialsAsBase64String(toolInfo.getUsername(), toolInfo.getPassword()));
} else {
response = restTemplate.exchange(queryBuilder.toString(), HttpMethod.GET,
zephyrUtil.buildBearerHeader(toolInfo.getPatOAuthToken()), ZephyrTestCaseDTO[].class);
}
if (response.getStatusCode() == HttpStatus.OK && Objects.nonNull(response.getBody())) {
testCaseList = Arrays.asList(response.getBody());
} else {
String statusCode = response.getStatusCode().toString();
log.error("Error while fetching projects from {}. with status {}", queryBuilder, statusCode);
throw new RestClientException("Got different status code: " + statusCode + " : " + response.getBody());
}
} catch (Exception exception) {
isClientException(toolInfo, exception);
log.error("Error while fetching projects from {}", exception.getMessage());
throw new RestClientException("Error while fetching projects from {}", exception);
testCaseList = getTestCaseList(testCaseList, toolInfo, queryBuilder);
}
return testCaseList;
}

private List<ZephyrTestCaseDTO> getTestCaseList(List<ZephyrTestCaseDTO> testCaseList, ProcessorToolConnection toolInfo, StringBuilder queryBuilder) {
if (StringUtils.isNotBlank(queryBuilder)) {
ResponseEntity<ZephyrTestCaseDTO[]> response = null;
try {
if (!toolInfo.isBearerToken()) {
response = makeRestCall(queryBuilder.toString(), ZephyrTestCaseDTO[].class, HttpMethod.GET,
zephyrUtil.getCredentialsAsBase64String(toolInfo.getUsername(), toolInfo.getPassword()));
} else {
response = restTemplate.exchange(queryBuilder.toString(), HttpMethod.GET,
zephyrUtil.buildBearerHeader(toolInfo.getPatOAuthToken()), ZephyrTestCaseDTO[].class);
}
if (response.getStatusCode() == HttpStatus.OK && Objects.nonNull(response.getBody())) {
testCaseList = Arrays.asList(response.getBody());
} else {
String statusCode = response.getStatusCode().toString();
log.error("Error while fetching projects from {}. with status {}", queryBuilder, statusCode);
throw new RestClientException("Got different status code: " + statusCode + " : " + response.getBody());
}
} catch (Exception exception) {
isClientException(toolInfo, exception);
log.error("Error while fetching projects from {}", exception.getMessage());
throw new RestClientException("Error while fetching projects from {}", exception);
}
}
return testCaseList;
}

private static void buildQuery(ProjectConfFieldMapping projectConfig, StringBuilder queryBuilder) {
if (ObjectUtils.isNotEmpty(projectConfig.getProcessorToolConnection().getProjectComponent())) {
queryBuilder.append(AND);
queryBuilder.append(COMPONENT).append(projectConfig.getProcessorToolConnection().getProjectComponent());
queryBuilder.append(INVERTED_COMMA);
}
}

/**
* REST client to make a REST call to the Zephyr cloud
*
Expand Down
Loading