Skip to content

Commit eb2324c

Browse files
cx-pedro-lopespedrompflopes
andauthored
Update checkmarx-ast-cli binaries with 2.0.63 (#271)
* Update checkmarx-ast-cli to 2.0.63 * change environment * change environment * change environment * Update ci.yml --------- Co-authored-by: pedrompflopes <[email protected]>
1 parent 5f0c497 commit eb2324c

File tree

8 files changed

+27
-24
lines changed

8 files changed

+27
-24
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
3838
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
3939
CX_TENANT: ${{ secrets.CX_TENANT }}
40-
CX_SCAN_ID: ${{ secrets.CX_SCAN_ID }}
4140
CX_APIKEY: ${{ secrets.CX_APIKEY }}
4241

4342

checkmarx-ast-cli.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.60
1+
2.0.63

src/main/resources/cx-linux

328 KB
Binary file not shown.

src/main/resources/cx-mac

713 KB
Binary file not shown.

src/main/resources/cx.exe

332 KB
Binary file not shown.

src/test/java/com/checkmarx/ast/BaseTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
public abstract class BaseTest {
1414

15-
public static final String CX_SCAN_ID = getEnvOrNull("CX_SCAN_ID");
1615
private static final String CX_BASE_URI = getEnvOrNull("CX_BASE_URI");
1716
private static final String CX_BASE_AUTH_URI = getEnvOrNull("CX_BASE_AUTH_URI");
1817
private static final String CX_TENANT = getEnvOrNull("CX_TENANT");

src/test/java/com/checkmarx/ast/PredicateTest.java

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,37 @@
99
import org.junit.jupiter.api.Test;
1010

1111
import java.util.List;
12+
import java.util.Map;
1213
import java.util.UUID;
1314

1415
class PredicateTest extends BaseTest {
1516

17+
public static final String TO_VERIFY = "TO_VERIFY";
18+
public static final String HIGH = "HIGH";
19+
1620
@Test
17-
void testTriageShow() throws Exception {
18-
Scan scan = wrapper.scanShow(UUID.fromString(CX_SCAN_ID));
21+
void testTriage() throws Exception {
22+
Map<String, String> params = commonParams();
23+
Scan scan = wrapper.scanCreate(params);
24+
UUID scanId = UUID.fromString(scan.getId());
25+
26+
Assertions.assertEquals("Completed", wrapper.scanShow(scanId).getStatus());
1927

20-
Results results = wrapper.results(UUID.fromString(CX_SCAN_ID));
28+
Results results = wrapper.results(scanId);
2129
Result result = results.getResults().stream().filter(res -> res.getType().equalsIgnoreCase(CxConstants.SAST)).findFirst().get();
2230

2331
List<Predicate> predicates = wrapper.triageShow(UUID.fromString(scan.getProjectId()), result.getSimilarityId(), result.getType());
2432

2533
Assertions.assertNotNull(predicates);
26-
}
27-
28-
@Test
29-
void testTriageUpdate() throws Exception {
30-
Scan scan = wrapper.scanShow(UUID.fromString(CX_SCAN_ID));
3134

32-
Results results = wrapper.results(UUID.fromString(CX_SCAN_ID));
33-
Result result = results.getResults().stream().filter(res -> res.getType().equalsIgnoreCase(CxConstants.SAST)).findFirst().get();
35+
try {
36+
wrapper.triageUpdate(UUID.fromString(scan.getProjectId()), result.getSimilarityId(), result.getType(), TO_VERIFY, "Edited via Java Wrapper", HIGH);
37+
} catch (Exception e) {
38+
Assertions.fail("Triage update failed. Should not throw exception");
39+
}
3440

3541
try {
36-
wrapper.triageUpdate(UUID.fromString(scan.getProjectId()), result.getSimilarityId(), result.getType(), "to_verify", "Edited via Java Wrapper", "high");
42+
wrapper.triageUpdate(UUID.fromString(scan.getProjectId()), result.getSimilarityId(), result.getType(), result.getState(), "Edited back to normal", result.getSeverity());
3743
} catch (Exception e) {
3844
Assertions.fail("Triage update failed. Should not throw exception");
3945
}

src/test/java/com/checkmarx/ast/ResultTest.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import java.util.ArrayList;
1616
import java.util.List;
17+
import java.util.Map;
1718
import java.util.UUID;
1819

1920
class ResultTest extends BaseTest {
@@ -68,23 +69,21 @@ void testResultsCodeBashing() throws Exception {
6869

6970
@Test
7071
void testResultsBflJSON() throws Exception {
72+
Map<String, String> params = commonParams();
73+
Scan scan = wrapper.scanCreate(params);
74+
UUID scanId = UUID.fromString(scan.getId());
75+
76+
Assertions.assertEquals("Completed", wrapper.scanShow(scanId).getStatus());
7177

72-
UUID scanId = UUID.fromString(CX_SCAN_ID);
7378
Results results = wrapper.results(scanId);
7479
Result result = results.getResults().stream().filter(res -> res.getType().equalsIgnoreCase(CxConstants.SAST)).findFirst().get();
7580
Data data = result.getData();
7681
String queryId = data.getQueryId();
7782
int bflNodeIndex = wrapper.getResultsBfl(scanId, queryId, data.getNodes());
7883
Assertions.assertTrue(bflNodeIndex == -1 || bflNodeIndex >= 0);
7984

80-
}
81-
82-
@Test
83-
void testResultsBflWithInvalidQueryId() throws Exception {
84-
85-
UUID scanId = UUID.fromString(CX_SCAN_ID);
86-
String queryId = "0000";
87-
int bflNodeIndex = wrapper.getResultsBfl(scanId, queryId, new ArrayList<Node>());
88-
Assertions.assertEquals(-1, bflNodeIndex);
85+
String queryIdInvalid = "0000";
86+
int bflNodeIndexInvalid = wrapper.getResultsBfl(scanId, queryIdInvalid, new ArrayList<Node>());
87+
Assertions.assertEquals(-1, bflNodeIndexInvalid);
8988
}
9089
}

0 commit comments

Comments
 (0)