@@ -362,13 +362,13 @@ func testXscAuditMaven(t *testing.T, format string) string {
362362}
363363
364364func TestXrayAuditGoJson (t * testing.T ) {
365- output := testXrayAuditGo (t , string (format .Json ), "go -project" )
366- validations .VerifyJsonResults (t , output , validations.ValidationParams {ExactResultsMatch : true })
365+ output := testXrayAuditGo (t , string (format .Json ), "simple -project" )
366+ validations .VerifyJsonResults (t , output , validations.ValidationParams {Licenses : 1 , Vulnerabilities : 4 })
367367}
368368
369369func TestXrayAuditGoSimpleJson (t * testing.T ) {
370- output := testXrayAuditGo (t , string (format .SimpleJson ), "missing-context " )
371- validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {ExactResultsMatch : true })
370+ output := testXrayAuditGo (t , string (format .SimpleJson ), "simple-project " )
371+ validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {Licenses : 3 , Vulnerabilities : 4 , NotCovered : 2 , NotApplicable : 2 })
372372}
373373
374374func testXrayAuditGo (t * testing.T , format , project string ) string {
@@ -377,7 +377,7 @@ func testXrayAuditGo(t *testing.T, format, project string) string {
377377 defer cleanUp ()
378378 // Add dummy descriptor file to check that we run only specific audit
379379 addDummyPackageDescriptor (t , false )
380- return securityTests .PlatformCli .RunCliCmdWithOutput (t , "audit" , "--go" , "--licenses" , "--format=" + format )
380+ return securityTests .PlatformCli .WithoutCredentials (). RunCliCmdWithOutput (t , "audit" , "--go" , "--licenses" , "--format=" + format )
381381}
382382
383383func TestXrayAuditNoTech (t * testing.T ) {
@@ -396,9 +396,9 @@ func TestXrayAuditMultiProjects(t *testing.T) {
396396 _ , cleanUp := securityTestUtils .CreateTestProjectEnvAndChdir (t , filepath .Join (filepath .FromSlash (securityTests .GetTestResourcesPath ()), "projects" ))
397397 defer cleanUp ()
398398 // Set working-dirs flag with multiple projects
399- workingDirsFlag := fmt .Sprintf ("--working-dirs=%s, %s ,%s, %s, %s " ,
399+ workingDirsFlag := fmt .Sprintf ("--working-dirs=%s, %s ,%s, %s" ,
400400 filepath .Join ("package-managers" , "maven" , "maven" ), filepath .Join ("package-managers" , "nuget" , "single4.0" ),
401- filepath .Join ("package-managers" , "python" , "pip" , "pip-project" ), filepath .Join ("jas" , "jas" ), filepath . Join ( "package-managers" , "go" , "missing-context" ) )
401+ filepath .Join ("package-managers" , "python" , "pip" , "pip-project" ), filepath .Join ("jas" , "jas" ))
402402 // Configure a new server named "default"
403403 securityIntegrationTestUtils .CreateJfrogHomeConfig (t , true )
404404 defer securityTestUtils .CleanTestsHomeEnv ()
@@ -414,7 +414,6 @@ func TestXrayAuditMultiProjects(t *testing.T) {
414414 Undetermined : 0 ,
415415 NotCovered : 22 ,
416416 NotApplicable : 2 ,
417- MissingContext : 1 ,
418417 })
419418}
420419
@@ -534,6 +533,11 @@ func TestXrayAuditWithoutSastCppFlagSimpleJson(t *testing.T) {
534533 validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {})
535534}
536535
536+ func TestXrayAuditJasMissingContextSimpleJson (t * testing.T ) {
537+ output := testXrayAuditJas (t , securityTests .PlatformCli , filepath .Join ("package-managers" , "maven" , "missing-context" ), "3" , false , false )
538+ validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {MissingContext : 1 })
539+ }
540+
537541func TestXrayAuditNotEntitledForJas (t * testing.T ) {
538542 integration .InitAuditGeneralTests (t , scangraph .GraphScanMinXrayVersion )
539543 cliToRun , cleanUp := integration .InitTestWithMockCommandOrParams (t , getNoJasAuditMockCommand )
0 commit comments