diff --git a/pkg/github/sarif_report_test.go b/pkg/github/sarif_report_test.go index 4721ccf..c5afacf 100644 --- a/pkg/github/sarif_report_test.go +++ b/pkg/github/sarif_report_test.go @@ -27,7 +27,7 @@ type MockReport struct { mock.Mock } -func (m *MockReport) Convert(findings []types.Finding) error { +func (m *MockReport) Convert(findings *types.Report) error { args := m.Called(findings) return args.Error(0) } diff --git a/pkg/sarif/reporter_test.go b/pkg/sarif/reporter_test.go index 4d82302..bdd1fcb 100644 --- a/pkg/sarif/reporter_test.go +++ b/pkg/sarif/reporter_test.go @@ -29,8 +29,8 @@ func TestSarifReporter_Convert(t *testing.T) { assert.NotNil(t, ref.report, "should have create an empty report") assert.NotNil(t, ref.run, "should have filled a run with details") - assert.Equal(t, len(ref.run.Results), 8, "example report should have 8 calls to vulnerabilities") - assert.Equal(t, len(ref.run.Tool.Driver.Rules), 8, "example report should have 8 vulnerabilities") + assert.Equal(t, len(ref.run.Results), 24, "example report should have 24 calls to vulnerabilities") + assert.Equal(t, len(ref.run.Tool.Driver.Rules), 9, "example report should have 9 vulnerabilities") assert.Equal(t, len(ref.report.Runs), 0, "should have not yet added the run to the report") }) @@ -38,7 +38,7 @@ func TestSarifReporter_Convert(t *testing.T) { target := NewSarifReporter(zerolog.Nop(), "/workspaces/govulncheck-action") ref := target.(*SarifReporter) - _ = target.Convert([]types.Finding{}) + _ = target.Convert(&types.Report{Vulnerabilities: []types.Entry{}, Findings: []types.Finding{}}) assert.NotNil(t, ref.report, "should have create an empty report") assert.NotNil(t, ref.run, "should have filled a run with details")