Skip to content

Commit 2e94ffb

Browse files
committed
chore: cleanup unrelated changes
1 parent 8905e86 commit 2e94ffb

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

internal/analysis/analysis_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,18 @@ func TestAnalysis_RunAnalysis_GetFindingsError(t *testing.T) {
642642
req := i.(*http.Request)
643643
return req.URL.String() == "http://localhost/rest/orgs/b6fc8954-5918-45ce-bc89-54591815ce1b/scans/a6fb2742-b67f-4dc3-bb27-42b67f1dc344?version=2024-02-16~experimental" &&
644644
req.Method == http.MethodGet
645+
})).Times(1).Return(&http.Response{
646+
StatusCode: http.StatusOK,
647+
Header: http.Header{
648+
"Content-Type": []string{"application/vnd.api+json"},
649+
},
650+
Body: io.NopCloser(bytes.NewReader([]byte(`{"data":{"attributes": {"status": "done", "components":[{"findings_url": "http://findings_url"}]}, "id": "a6fb2742-b67f-4dc3-bb27-42b67f1dc344"}}`))),
651+
}, nil)
652+
653+
mockHTTPClient.EXPECT().Do(mock.MatchedBy(func(i interface{}) bool {
654+
req := i.(*http.Request)
655+
return req.URL.String() == "http://findings_url" &&
656+
req.Method == http.MethodGet
645657
})).Times(1).Return(nil, errors.New("error"))
646658

647659
analysisOrchestrator := analysis.NewAnalysisOrchestrator(
@@ -654,9 +666,8 @@ func TestAnalysis_RunAnalysis_GetFindingsError(t *testing.T) {
654666
)
655667

656668
_, err := analysisOrchestrator.RunAnalysis(context.Background(), "b6fc8954-5918-45ce-bc89-54591815ce1b", "rootPath", "c172d1db-b465-4764-99e1-ecedad03b06a")
657-
assert.ErrorContains(t, err, "error")
669+
require.ErrorContains(t, err, "error")
658670
}
659-
660671
func TestAnalysis_RunAnalysis_GetFindingsNotSuccessful(t *testing.T) {
661672
mockConfig, mockHTTPClient, mockInstrumentor, mockErrorReporter, mockTracker, mockTrackerFactory, logger := setup(t, nil)
662673

internal/api/test/2024-12-21/client.go

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)