@@ -17,6 +17,7 @@ import (
1717 "github.com/jfrog/jfrog-cli-security/utils/formats"
1818 "github.com/jfrog/jfrog-cli-security/utils/validations"
1919
20+ testsUtils "github.com/jfrog/jfrog-cli-security/tests/utils"
2021 xrayUtils "github.com/jfrog/jfrog-client-go/xray/services/utils"
2122
2223 "github.com/stretchr/testify/assert"
@@ -566,7 +567,7 @@ func TestXrayAuditWithoutSastCppFlagSimpleJson(t *testing.T) {
566567}
567568
568569func TestXrayAuditNotEntitledForJas (t * testing.T ) {
569- cliToRun , cleanUp := securityTestUtils .InitTestWithMockCommandOrParams (t , getNoJasAuditMockCommand )
570+ cliToRun , cleanUp := securityTestUtils .InitTestWithMockCommandOrParams (t , false , getNoJasAuditMockCommand )
570571 defer cleanUp ()
571572 output := testXrayAuditJas (t , cliToRun , filepath .Join ("jas" , "jas" ), "3" , false , false )
572573 validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {Vulnerabilities : 8 })
@@ -739,3 +740,31 @@ func TestAuditOnEmptyProject(t *testing.T) {
739740 // No issues should be found in an empty project
740741 validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {})
741742}
743+
744+ // xray-url only - the following tests check the case of adding "xray-url", instead of "url", which is the more common one
745+
746+ func TestXrayAuditNotEntitledForJasWithXrayUrl (t * testing.T ) {
747+ cliToRun , cleanUp := securityTestUtils .InitTestWithMockCommandOrParams (t , true , getNoJasAuditMockCommand )
748+ defer cleanUp ()
749+ output := testXrayAuditJas (t , cliToRun , filepath .Join ("jas" , "jas" ), "3" , false , false )
750+ // Verify that scan results are printed
751+ validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {Vulnerabilities : 8 })
752+ // Verify that JAS results are not printed
753+ validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {})
754+ }
755+
756+ func TestXrayAuditJasSimpleJsonWithXrayUrl (t * testing.T ) {
757+ cliToRun := testsUtils .GetTestCli (cli .GetJfrogCliSecurityApp (), true )
758+ output := testXrayAuditJas (t , cliToRun , filepath .Join ("jas" , "jas" ), "3" , false , false )
759+ validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {
760+ Sast : 1 ,
761+ Iac : 9 ,
762+ Secrets : 6 ,
763+
764+ Vulnerabilities : 8 ,
765+ Applicable : 3 ,
766+ Undetermined : 1 ,
767+ NotCovered : 1 ,
768+ NotApplicable : 2 ,
769+ })
770+ }
0 commit comments