File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
test/mocks/mock_utils/http Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1+ package mock_executor
2+
3+ import (
4+ "soarca/utils/http"
5+
6+ "github.com/stretchr/testify/mock"
7+ )
8+
9+ type MockHttpOptions struct {
10+ mock.Mock
11+ }
12+
13+ type MockHttpRequest struct {
14+ mock.Mock
15+ }
16+
17+ func (httpOptions * MockHttpOptions ) ExtractUrl () (string , error ) {
18+ args := httpOptions .Called ()
19+ return args .String (0 ), args .Error (1 )
20+ }
21+
22+ func (httpOptions * MockHttpRequest ) Request (options http.HttpOptions ) ([]byte , error ) {
23+ args := httpOptions .Called (options )
24+ return args .Get (0 ).([]byte ), args .Error (1 )
25+ }
Original file line number Diff line number Diff line change @@ -27,8 +27,11 @@ type HttpOptions struct {
2727 Auth * cacao.AuthenticationInformation
2828}
2929
30+ type IHttpOptions interface {
31+ ExtractUrl () (string , error )
32+ }
3033type IHttpRequest interface {
31- Request () ([]byte , error )
34+ Request (httpOptions HttpOptions ) ([]byte , error )
3235}
3336
3437type HttpRequest struct {}
You can’t perform that action at this time.
0 commit comments