@@ -131,8 +131,10 @@ func Test_callback_SBOMResolution(t *testing.T) {
131131 ctx .config .Set (configuration .API_URL , mockSBOMService .URL )
132132
133133 mockUVClient := & mocks.MockUVClient {
134- ExportSBOMFunc : func (_ string ) ([]byte , error ) {
135- return []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ), nil
134+ ExportSBOMFunc : func (_ string ) (* scaplugin.Finding , error ) {
135+ return & scaplugin.Finding {
136+ Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ),
137+ }, nil
136138 },
137139 }
138140
@@ -159,7 +161,7 @@ func Test_callback_SBOMResolution(t *testing.T) {
159161 resolutionHandler := NewCalledResolutionHandlerFunc (nil , nil )
160162
161163 mockUVClient := & mocks.MockUVClient {
162- ExportSBOMFunc : func (_ string ) ([] byte , error ) {
164+ ExportSBOMFunc : func (_ string ) (* scaplugin. Finding , error ) {
163165 return nil , fmt .Errorf ("uv command failed" )
164166 },
165167 }
@@ -187,8 +189,10 @@ func Test_callback_SBOMResolution(t *testing.T) {
187189 ctx .config .Set (configuration .API_URL , mockSBOMService .URL )
188190
189191 mockUVClient := & mocks.MockUVClient {
190- ExportSBOMFunc : func (_ string ) ([]byte , error ) {
191- return []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ), nil
192+ ExportSBOMFunc : func (_ string ) (* scaplugin.Finding , error ) {
193+ return & scaplugin.Finding {
194+ Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ),
195+ }, nil
192196 },
193197 }
194198
@@ -238,8 +242,8 @@ func Test_callback_SBOMResolution(t *testing.T) {
238242 // Create mock plugin that returns two findings
239243 mockPlugin := & mockScaPlugin {
240244 findings : []scaplugin.Finding {
241- {Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ), FilesProcessed : []string {}},
242- {Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[{"name":"test"}]}` ), FilesProcessed : []string {}},
245+ {Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ), FileExclusions : []string {}},
246+ {Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[{"name":"test"}]}` ), FileExclusions : []string {}},
243247 },
244248 }
245249
@@ -268,8 +272,10 @@ func Test_callback_SBOMResolution(t *testing.T) {
268272 ctx .config .Set (configuration .API_URL , mockSBOMService .URL )
269273
270274 mockUVClient := & mocks.MockUVClient {
271- ExportSBOMFunc : func (_ string ) ([]byte , error ) {
272- return []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ), nil
275+ ExportSBOMFunc : func (_ string ) (* scaplugin.Finding , error ) {
276+ return & scaplugin.Finding {
277+ Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ),
278+ }, nil
273279 },
274280 }
275281
@@ -291,19 +297,19 @@ func Test_callback_SBOMResolution(t *testing.T) {
291297 t .Run ("handleSBOMResolution with FlagAllProjects" , func (t * testing.T ) {
292298 finding1 := scaplugin.Finding {
293299 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ),
294- FilesProcessed : []string {"uv.lock" , "pyproject.toml" },
300+ FileExclusions : []string {"uv.lock" , "pyproject.toml" },
295301 }
296302 finding2 := scaplugin.Finding {
297303 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[{"name":"test"}]}` ),
298- FilesProcessed : []string {"requirements.txt" , "setup.py" },
304+ FileExclusions : []string {"requirements.txt" , "setup.py" },
299305 }
300306 finding3 := scaplugin.Finding {
301307 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[{"name":"someFinding"}]}` ),
302- FilesProcessed : []string {"package.json" },
308+ FileExclusions : []string {"package.json" },
303309 }
304310 finding4 := scaplugin.Finding {
305311 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[{"name":"anotherFinding"}]}` ),
306- FilesProcessed : []string {"go.mod" },
312+ FileExclusions : []string {"go.mod" },
307313 }
308314
309315 tc := []struct {
@@ -514,7 +520,7 @@ func Test_callback_SBOMResolution(t *testing.T) {
514520 findings : []scaplugin.Finding {
515521 {
516522 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ),
517- FilesProcessed : []string {"uv.lock" },
523+ FileExclusions : []string {"uv.lock" },
518524 },
519525 },
520526 }
@@ -584,7 +590,7 @@ func Test_callback_SBOMResolution(t *testing.T) {
584590 findings : []scaplugin.Finding {
585591 {
586592 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5","components":[]}` ),
587- FilesProcessed : []string {"uv.lock" },
593+ FileExclusions : []string {"uv.lock" },
588594 },
589595 },
590596 }
@@ -626,7 +632,7 @@ func Test_getExclusionsFromFindings(t *testing.T) {
626632 findings : []scaplugin.Finding {
627633 {
628634 Sbom : []byte (`{"bomFormat":"CycloneDX"}` ),
629- FilesProcessed : []string {},
635+ FileExclusions : []string {},
630636 },
631637 },
632638 expected : []string {},
@@ -636,7 +642,7 @@ func Test_getExclusionsFromFindings(t *testing.T) {
636642 findings : []scaplugin.Finding {
637643 {
638644 Sbom : []byte (`{"bomFormat":"CycloneDX"}` ),
639- FilesProcessed : []string {"file1.py" , "file2.py" },
645+ FileExclusions : []string {"file1.py" , "file2.py" },
640646 },
641647 },
642648 expected : []string {"file1.py" , "file2.py" },
@@ -646,11 +652,11 @@ func Test_getExclusionsFromFindings(t *testing.T) {
646652 findings : []scaplugin.Finding {
647653 {
648654 Sbom : []byte (`{"bomFormat":"CycloneDX"}` ),
649- FilesProcessed : []string {"file1.py" , "file2.py" },
655+ FileExclusions : []string {"file1.py" , "file2.py" },
650656 },
651657 {
652658 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5"}` ),
653- FilesProcessed : []string {"file3.py" , "file4.py" , "file5.py" },
659+ FileExclusions : []string {"file3.py" , "file4.py" , "file5.py" },
654660 },
655661 },
656662 expected : []string {"file1.py" , "file2.py" , "file3.py" , "file4.py" , "file5.py" },
@@ -660,15 +666,15 @@ func Test_getExclusionsFromFindings(t *testing.T) {
660666 findings : []scaplugin.Finding {
661667 {
662668 Sbom : []byte (`{"bomFormat":"CycloneDX"}` ),
663- FilesProcessed : []string {},
669+ FileExclusions : []string {},
664670 },
665671 {
666672 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.5"}` ),
667- FilesProcessed : []string {"file1.py" },
673+ FileExclusions : []string {"file1.py" },
668674 },
669675 {
670676 Sbom : []byte (`{"bomFormat":"CycloneDX","specVersion":"1.6"}` ),
671- FilesProcessed : []string {"file2.py" , "file3.py" },
677+ FileExclusions : []string {"file2.py" , "file3.py" },
672678 },
673679 },
674680 expected : []string {"file1.py" , "file2.py" , "file3.py" },
0 commit comments