@@ -10,7 +10,7 @@ import (
10
10
"github.com/aquasecurity/trivy/pkg/commands/artifact"
11
11
ftypes "github.com/aquasecurity/trivy/pkg/fanal/types"
12
12
"github.com/aquasecurity/trivy/pkg/flag"
13
- "github.com/aquasecurity/trivy/pkg/types"
13
+ ptypes "github.com/aquasecurity/trivy/pkg/types"
14
14
codacy "github.com/codacy/codacy-engine-golang-seed/v6"
15
15
"github.com/stretchr/testify/assert"
16
16
"go.uber.org/mock/gomock"
@@ -61,20 +61,21 @@ func TestRun(t *testing.T) {
61
61
SkipJavaDBUpdate : true ,
62
62
},
63
63
PackageOptions : flag.PackageOptions {
64
- PkgTypes : []string {types .PkgTypeLibrary },
64
+ PkgTypes : []string {ptypes .PkgTypeLibrary },
65
+ PkgRelationships : ftypes .Relationships ,
65
66
},
66
67
ReportOptions : flag.ReportOptions {
67
68
ListAllPkgs : true ,
68
69
},
69
70
ScanOptions : flag.ScanOptions {
70
71
OfflineScan : true ,
71
- Scanners : types .Scanners {types .VulnerabilityScanner },
72
+ Scanners : ptypes .Scanners {ptypes .VulnerabilityScanner },
72
73
Target : sourceDir ,
73
74
},
74
75
}
75
76
76
- report := types .Report {
77
- Results : types .Results {
77
+ report := ptypes .Report {
78
+ Results : ptypes .Results {
78
79
{
79
80
Target : file1 ,
80
81
Packages : ftypes.Packages {
@@ -90,7 +91,7 @@ func TestRun(t *testing.T) {
90
91
ID : packageID2 ,
91
92
},
92
93
},
93
- Vulnerabilities : []types .DetectedVulnerability {
94
+ Vulnerabilities : []ptypes .DetectedVulnerability {
94
95
{
95
96
PkgID : packageID1 ,
96
97
VulnerabilityID : "vuln id" ,
@@ -119,13 +120,13 @@ func TestRun(t *testing.T) {
119
120
},
120
121
{
121
122
Target : file2 ,
122
- Secrets : []types .DetectedSecret {
123
+ Secrets : []ptypes .DetectedSecret {
123
124
{
124
125
StartLine : 2 ,
125
126
Title : "secret title" ,
126
127
},
127
128
},
128
- Vulnerabilities : []types .DetectedVulnerability {
129
+ Vulnerabilities : []ptypes .DetectedVulnerability {
129
130
{
130
131
PkgID : "packageID10" ,
131
132
VulnerabilityID : "no line" ,
@@ -138,7 +139,7 @@ func TestRun(t *testing.T) {
138
139
},
139
140
{
140
141
Target : "file-3" ,
141
- Secrets : []types .DetectedSecret {
142
+ Secrets : []ptypes .DetectedSecret {
142
143
{
143
144
StartLine : 10 ,
144
145
Title : "unkown file" ,
@@ -294,14 +295,15 @@ func TestRunScanFilesystemError(t *testing.T) {
294
295
SkipJavaDBUpdate : true ,
295
296
},
296
297
PackageOptions : flag.PackageOptions {
297
- PkgTypes : []string {types .PkgTypeLibrary },
298
+ PkgTypes : []string {ptypes .PkgTypeLibrary },
299
+ PkgRelationships : ftypes .Relationships ,
298
300
},
299
301
ReportOptions : flag.ReportOptions {
300
302
ListAllPkgs : true ,
301
303
},
302
304
ScanOptions : flag.ScanOptions {
303
305
OfflineScan : true ,
304
- Scanners : types .Scanners {types .VulnerabilityScanner },
306
+ Scanners : ptypes .Scanners {ptypes .VulnerabilityScanner },
305
307
Target : sourceDir ,
306
308
},
307
309
}
@@ -315,7 +317,7 @@ func TestRunScanFilesystemError(t *testing.T) {
315
317
mockRunner .EXPECT ().ScanFilesystem (
316
318
gomock .Eq (ctx ),
317
319
gomock .Eq (config ),
318
- ).Return (types .Report {}, assert .AnError ).Times (1 )
320
+ ).Return (ptypes .Report {}, assert .AnError ).Times (1 )
319
321
mockRunner .EXPECT ().Close (
320
322
gomock .Eq (ctx ),
321
323
).Return (nil ).Times (1 )
0 commit comments