Skip to content

Commit b1ec1a5

Browse files
changing result to results show (#76)
* changing result to results show * changing result to results show + new logo * fix predicate test Co-authored-by: Pedro Lopes <[email protected]>
1 parent aa1346f commit b1ec1a5

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
3030
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
3131
CX_TENANT: ${{ secrets.CX_TENANT }}
32+
CX_SCAN_ID: ${{ secrets.CX_SCAN_ID }}
3233
run: mvn -B test --file pom.xml
3334
cx-scan:
3435
runs-on: ubuntu-latest

logo.png

8.69 KB
Loading

src/main/java/com/checkmarx/ast/wrapper/CxConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class CxConstants {
2828
static final String SUB_CMD_CREATE = "create";
2929
static final String CMD_TRIAGE = "triage";
3030
static final String SUB_CMD_UPDATE = "update";
31-
static final String CMD_RESULT = "result";
31+
static final String CMD_RESULT = "results";
3232
static final String FORMAT = "--format";
3333
static final String SCAN_INFO_FORMAT = "--scan-info-format";
3434
static final String FORMAT_JSON = "json";

src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ public String results(@NonNull UUID scanId, ReportFormat reportFormat)
222222

223223
List<String> arguments = new ArrayList<>();
224224
arguments.add(CxConstants.CMD_RESULT);
225+
arguments.add(CxConstants.SUB_CMD_SHOW);
225226
arguments.add(CxConstants.SCAN_ID);
226227
arguments.add(scanId.toString());
227228
arguments.add(CxConstants.REPORT_FORMAT);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public void init() throws Exception {
2020
wrapper = new CxWrapper(getConfig(), getLogger());
2121
}
2222

23+
public static final String CX_SCAN_ID = getEnvOrNull("CX_SCAN_ID");
24+
2325
private static final String CX_BASE_URI = getEnvOrNull("CX_BASE_URI");
2426
private static final String CX_BASE_AUTH_URI = getEnvOrNull("CX_BASE_AUTH_URI");
2527
private static final String CX_TENANT = getEnvOrNull("CX_TENANT");

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ class PredicateTest extends BaseTest {
1515

1616
@Test
1717
void testTriageShow() throws Exception {
18-
List<Scan> scanList = wrapper.scanList(String.format("statuses=Completed"));
19-
Scan scan = scanList.get(0);
20-
Assertions.assertTrue(scanList.size() > 0);
21-
String scanId = scanList.get(0).getId();
18+
Scan scan = wrapper.scanShow(UUID.fromString(CX_SCAN_ID));
2219

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

2623
List<Predicate> predicates = wrapper.triageShow(UUID.fromString(scan.getProjectId()), result.getSimilarityId(), result.getType());
@@ -30,12 +27,9 @@ void testTriageShow() throws Exception {
3027

3128
@Test
3229
void testTriageUpdate() throws Exception {
33-
List<Scan> scanList = wrapper.scanList(String.format("statuses=Completed"));
34-
Scan scan = scanList.get(0);
35-
Assertions.assertTrue(scanList.size() > 0);
36-
String scanId = scanList.get(0).getId();
30+
Scan scan = wrapper.scanShow(UUID.fromString(CX_SCAN_ID));
3731

38-
Results results = wrapper.results(UUID.fromString(scanId));
32+
Results results = wrapper.results(UUID.fromString(CX_SCAN_ID));
3933
Result result = results.getResults().stream().filter(res -> res.getType().equalsIgnoreCase(CxConstants.SAST)).findFirst().get();
4034

4135
try {

0 commit comments

Comments
 (0)