Skip to content

Commit 65d7e2a

Browse files
Removing ASCA ignore file path changes
1 parent 36872e6 commit 65d7e2a

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public List<Project> projectList(String filter) throws IOException, InterruptedE
248248
return Execution.executeCommand(withConfigArguments(arguments), logger, Project::listFromLine);
249249
}
250250

251-
public ScanResult ScanAsca(String fileSource, boolean ascaLatestVersion, String agent, String ignoredFilePath) throws IOException, InterruptedException, CxException {
251+
public ScanResult ScanAsca(String fileSource, boolean ascaLatestVersion, String agent) throws IOException, InterruptedException, CxException {
252252
this.logger.info("Fetching ASCA scanResult");
253253

254254
List<String> arguments = new ArrayList<>();
@@ -259,10 +259,6 @@ public ScanResult ScanAsca(String fileSource, boolean ascaLatestVersion, String
259259
if (ascaLatestVersion) {
260260
arguments.add(CxConstants.ASCA_LATEST_VERSION);
261261
}
262-
if (StringUtils.isNotBlank(ignoredFilePath)) {
263-
arguments.add(CxConstants.IGNORED_FILE_PATH);
264-
arguments.add(ignoredFilePath);
265-
}
266262

267263
appendAgentToArguments(agent, arguments);
268264

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

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void testScanShow() throws Exception {
2525

2626
@Test
2727
void testScanAsca_WhenFileWithVulnerabilitiesIsSentWithAgent_ReturnSuccessfulResponseWithCorrectValues() throws Exception {
28-
ScanResult scanResult = wrapper.ScanAsca("src/test/resources/python-vul-file.py", true, "vscode", null);
28+
ScanResult scanResult = wrapper.ScanAsca("src/test/resources/python-vul-file.py", true, "vscode");
2929

3030
// Assertions for the scan result
3131
Assertions.assertNotNull(scanResult.getRequestId(), "Request ID should not be null");
@@ -46,7 +46,7 @@ void testScanAsca_WhenFileWithVulnerabilitiesIsSentWithAgent_ReturnSuccessfulRes
4646

4747
@Test
4848
void testScanAsca_WhenFileWithoutVulnerabilitiesIsSent_ReturnSuccessfulResponseWithCorrectValues() throws Exception {
49-
ScanResult scanResult = wrapper.ScanAsca("src/test/resources/csharp-no-vul.cs", true, null, null);
49+
ScanResult scanResult = wrapper.ScanAsca("src/test/resources/csharp-no-vul.cs", true, null);
5050
Assertions.assertNotNull(scanResult.getRequestId());
5151
Assertions.assertTrue(scanResult.isStatus());
5252
Assertions.assertNull(scanResult.getError());
@@ -55,25 +55,12 @@ void testScanAsca_WhenFileWithoutVulnerabilitiesIsSent_ReturnSuccessfulResponseW
5555

5656
@Test
5757
void testScanAsca_WhenMissingFileExtension_ReturnFileExtensionIsRequiredFailure() throws Exception {
58-
ScanResult scanResult = wrapper.ScanAsca("CODEOWNERS", true, null, null);
58+
ScanResult scanResult = wrapper.ScanAsca("CODEOWNERS", true, null);
5959
Assertions.assertNotNull(scanResult.getRequestId());
6060
Assertions.assertNotNull(scanResult.getError());
6161
Assertions.assertEquals("The file name must have an extension.", scanResult.getError().getDescription());
6262
}
6363

64-
@Test
65-
void testScanAsca_WithIgnoreFilePath_ShouldWorkCorrectly() throws Exception {
66-
String ignoreFile = "src/test/resources/ignored-packages.json";
67-
68-
// Test with ignore file - should not break the scanning process
69-
ScanResult scanResult = wrapper.ScanAsca("src/test/resources/python-vul-file.py", true, "test-agent", ignoreFile);
70-
71-
// Verify the scan completes successfully
72-
Assertions.assertNotNull(scanResult.getRequestId(), "Request ID should not be null");
73-
Assertions.assertTrue(scanResult.isStatus(), "Status should be true");
74-
Assertions.assertNull(scanResult.getError(), "Error should be null when scan is successful");
75-
}
76-
7764
@Test
7865
void testScanList() throws Exception {
7966
List<Scan> cxOutput = wrapper.scanList("limit=10");

0 commit comments

Comments
 (0)