Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
  • Loading branch information
fjogeleit committed Sep 5, 2024
1 parent dea2c73 commit db44606
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/listener/cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func Test_CleanupListener(t *testing.T) {
c := &client{}

slistener := listener.NewCleanupListener(ctx, target.NewCollection(&target.Target{Client: c}))
slistener(report.LifecycleEvent{Type: report.Added, PolicyReport: preport1})
slistener(report.LifecycleEvent{Type: report.Deleted, PolicyReport: preport1})

assert.True(t, c.cleanupCalled, "expected cleanup method was called")
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/target/securityhub/securityhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (c *client) mapFindings(polr v1alpha2.ReportInterface, results []v1alpha2.P
}

func (c *client) Send(result v1alpha2.PolicyReportResult) {
c.BatchSend(nil, []v1alpha2.PolicyReportResult{result})
c.BatchSend(&v1alpha2.PolicyReport{}, []v1alpha2.PolicyReportResult{result})
}

func (c *client) BatchSend(polr v1alpha2.ReportInterface, results []v1alpha2.PolicyReportResult) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/target/securityhub/securityhub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func (c *client) GetFindings(ctx context.Context, params *hub.GetFindingsInput,
}

func (c *client) BatchUpdateFindings(ctx context.Context, params *hub.BatchUpdateFindingsInput, optFns ...func(*hub.Options)) (*hub.BatchUpdateFindingsOutput, error) {
c.fetched = true
c.batched = true

return &hub.BatchUpdateFindingsOutput{}, nil
}

Expand Down

0 comments on commit db44606

Please sign in to comment.