Skip to content

Commit c6250db

Browse files
add integration test
1 parent 90412c7 commit c6250db

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/integration/scan_test.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"log"
1313
"os"
1414
"path/filepath"
15+
"reflect"
1516
"runtime"
1617
"strings"
1718
"testing"
@@ -1551,7 +1552,9 @@ func TestScanGeneratingPdfReportWithPdfOptions(t *testing.T) {
15511552
//}
15521553

15531554
func TestScanCreateUsingWrongProjectGroups(t *testing.T) {
1554-
_, projectName := getRootProject(t)
1555+
projectID, projectName := getRootProject(t)
1556+
project := showProject(t, projectID)
1557+
groupsBeforeScanCreate := project.Groups
15551558

15561559
args := []string{
15571560
scanCommand, "create",
@@ -1561,10 +1564,20 @@ func TestScanCreateUsingWrongProjectGroups(t *testing.T) {
15611564
flag(params.PresetName), "Checkmarx Default",
15621565
flag(params.BranchFlag), "dummy_branch",
15631566
flag(params.ProjectGroupList), "wrong_group",
1567+
"--async",
15641568
}
15651569

15661570
err, _ := executeCommand(t, args...)
1567-
assertError(t, err, "Failed finding groups")
1571+
if err != nil {
1572+
assertError(t, err, "running a scan should pass")
1573+
}
1574+
1575+
project = showProject(t, projectID)
1576+
groupsAfterScanCreate := project.Groups
1577+
if !reflect.DeepEqual(groupsBeforeScanCreate, groupsAfterScanCreate) {
1578+
t.Errorf("When project exists, groups before and after scan creation should be equal. Got %v, want %v", groupsAfterScanCreate, groupsBeforeScanCreate)
1579+
}
1580+
15681581
}
15691582
func TestScanCreateExploitablePath(t *testing.T) {
15701583
_, projectName := getRootProject(t)

0 commit comments

Comments
 (0)