Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
CX_TENANT: ${{ secrets.CX_TENANT }}
CX_SCAN_ID: ${{ secrets.CX_SCAN_ID }}
run: mvn -B test --file pom.xml
cx-scan:
runs-on: ubuntu-latest
Expand Down
Binary file modified logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/java/com/checkmarx/ast/wrapper/CxConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class CxConstants {
static final String SUB_CMD_CREATE = "create";
static final String CMD_TRIAGE = "triage";
static final String SUB_CMD_UPDATE = "update";
static final String CMD_RESULT = "result";
static final String CMD_RESULT = "results";
static final String FORMAT = "--format";
static final String SCAN_INFO_FORMAT = "--scan-info-format";
static final String FORMAT_JSON = "json";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public String results(@NonNull UUID scanId, ReportFormat reportFormat)

List<String> arguments = new ArrayList<>();
arguments.add(CxConstants.CMD_RESULT);
arguments.add(CxConstants.SUB_CMD_SHOW);
arguments.add(CxConstants.SCAN_ID);
arguments.add(scanId.toString());
arguments.add(CxConstants.REPORT_FORMAT);
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/checkmarx/ast/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public void init() throws Exception {
wrapper = new CxWrapper(getConfig(), getLogger());
}

public static final String CX_SCAN_ID = getEnvOrNull("CX_SCAN_ID");

private static final String CX_BASE_URI = getEnvOrNull("CX_BASE_URI");
private static final String CX_BASE_AUTH_URI = getEnvOrNull("CX_BASE_AUTH_URI");
private static final String CX_TENANT = getEnvOrNull("CX_TENANT");
Expand Down
14 changes: 4 additions & 10 deletions src/test/java/com/checkmarx/ast/PredicateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ class PredicateTest extends BaseTest {

@Test
void testTriageShow() throws Exception {
List<Scan> scanList = wrapper.scanList(String.format("statuses=Completed"));
Scan scan = scanList.get(0);
Assertions.assertTrue(scanList.size() > 0);
String scanId = scanList.get(0).getId();
Scan scan = wrapper.scanShow(UUID.fromString(CX_SCAN_ID));

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

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

@Test
void testTriageUpdate() throws Exception {
List<Scan> scanList = wrapper.scanList(String.format("statuses=Completed"));
Scan scan = scanList.get(0);
Assertions.assertTrue(scanList.size() > 0);
String scanId = scanList.get(0).getId();
Scan scan = wrapper.scanShow(UUID.fromString(CX_SCAN_ID));

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

try {
Expand Down