@@ -361,6 +361,25 @@ func testXscAuditMaven(t *testing.T, format string) string {
361361 return securityTests .PlatformCli .RunCliCmdWithOutput (t , "audit" , "--mvn" , "--licenses" , "--format=" + format )
362362}
363363
364+ func TestXrayAuditGoJson (t * testing.T ) {
365+ output := testXrayAuditGo (t , string (format .Json ), "go-project" )
366+ validations .VerifyJsonResults (t , output , validations.ValidationParams {ExactResultsMatch : true })
367+ }
368+
369+ func TestXrayAuditGoSimpleJson (t * testing.T ) {
370+ output := testXrayAuditGo (t , string (format .SimpleJson ), "missing-context" )
371+ validations .VerifySimpleJsonResults (t , output , validations.ValidationParams {ExactResultsMatch : true })
372+ }
373+
374+ func testXrayAuditGo (t * testing.T , format , project string ) string {
375+ integration .InitAuditJavaTest (t , scangraph .GraphScanMinXrayVersion )
376+ _ , cleanUp := securityTestUtils .CreateTestProjectEnvAndChdir (t , filepath .Join (filepath .FromSlash (securityTests .GetTestResourcesPath ()), "projects" , "package-managers" , "go" , project ))
377+ defer cleanUp ()
378+ // Add dummy descriptor file to check that we run only specific audit
379+ addDummyPackageDescriptor (t , false )
380+ return securityTests .PlatformCli .RunCliCmdWithOutput (t , "audit" , "--go" , "--licenses" , "--format=" + format )
381+ }
382+
364383func TestXrayAuditNoTech (t * testing.T ) {
365384 integration .InitAuditGeneralTests (t , scangraph .GraphScanMinXrayVersion )
366385 tempDirPath , createTempDirCallback := coreTests .CreateTempDirWithCallbackAndAssert (t )
0 commit comments