Skip to content

Commit

Permalink
Merge pull request #21 from checkmarx-ltd/develop
Browse files Browse the repository at this point in the history
fix cxgo-scan-completed status value (#20)
  • Loading branch information
AvivCx authored Nov 9, 2020
2 parents 1117534 + 8e19307 commit fb49068
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.github.checkmarx-ltd</groupId>
<artifactId>cx-spring-boot-sdk</artifactId>
<version>0.4.57</version>
<version>0.4.58</version>
<name>cx-spring-boot-sdk</name>
<description>Checkmarx Java Spring Boot SDK</description>
<properties>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/cx/restclient/CxGoClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public class CxGoClientImpl implements ScannerClient {
private static final String DEEP_LINK = "/scan/business-unit/%s/application/%s/project/%s/scans/%s";
private static final String SCA_DEEP_LINK = "/scan/business-unit/%s/application/%s/project/%s";
private static final String ADDITIONAL_DETAILS_KEY = "results";
private static final String CXGO_SCAN_STATUS_DONE = "Done";
private static final String CXGO_SCAN_STATUS_PARTIAL = "Partial";
private static final String CXGO_SCAN_STATUS_COMPLETED = "Completed";

/// CxOD required extra information for API calls not used by the SAST SDK. This
/// data structure is used to capture that information as CxService calls are made
Expand Down Expand Up @@ -866,8 +869,9 @@ private void setupScanIdMap(Integer scanID, Integer projectID) {
public Integer getLastScanId(Integer projectId) {
OdScanList appList = getScanStatusPage(projectId);
for(OdScanListDataItem item : appList.getData().getItems()) {
if(item.getStatus().equals("Done")) {
if(item.getStatus().equals(CXGO_SCAN_STATUS_DONE) || item.getStatus().equals(CXGO_SCAN_STATUS_PARTIAL) || item.getStatus().equals(CXGO_SCAN_STATUS_COMPLETED)) {
this.setupScanIdMap(item.getId(), projectId);
log.debug("getLastScanId - Found scanId '{}', with status: '{}'", item.getId(), item.getStatus());
return item.getId();
}
}
Expand Down

0 comments on commit fb49068

Please sign in to comment.