Skip to content

Commit

Permalink
small CR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
checkmarx-kobi-hagmi committed May 30, 2024
1 parent 70dc0d8 commit fcb8a47
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public List<Project> projectList(String filter) throws IOException, InterruptedE
return Execution.executeCommand(withConfigArguments(arguments), logger, Project::listFromLine);
}

public ScanResult ScanVorpal(String fileSource, Boolean vorpalLatestVersion) throws IOException, InterruptedException, CxException {
public ScanResult ScanVorpal(String fileSource, boolean vorpalLatestVersion) throws IOException, InterruptedException, CxException {
this.logger.info("Fetching Vorpal scanResult");

List<String> arguments = new ArrayList<>();
Expand Down
9 changes: 6 additions & 3 deletions src/test/java/com/checkmarx/ast/ScanTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand All @@ -22,15 +25,15 @@ void testScanShow() throws Exception {

@Test
void testScanVorpalSuccessfulResponse() throws Exception {
ScanResult scanResult = wrapper.ScanVorpal("my-file.cs", true);
Assertions.assertEquals("1234567890", scanResult.getRequestId());
ScanResult scanResult = wrapper.ScanVorpal("src/test/resources/csharp-file.cs", true);
Assertions.assertNotNull(scanResult.getRequestId());
Assertions.assertTrue(scanResult.isStatus());
Assertions.assertNull(scanResult.getError());
}

@Test
void testScanVorpalFailureResponse() throws Exception {
ScanResult scanResult = wrapper.ScanVorpal("my-file.cs", false);
ScanResult scanResult = wrapper.ScanVorpal("src/test/resources/csharp-file.cs", false);
Assertions.assertEquals("1111", scanResult.getRequestId());
Assertions.assertFalse(scanResult.isStatus());
Assertions.assertNotNull(scanResult.getError());
Expand Down
Loading

0 comments on commit fcb8a47

Please sign in to comment.