/
Connector.go
83 lines (67 loc) · 2.33 KB
/
Connector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Code generated by mockery v2.30.1. DO NOT EDIT.
package mocks
import (
context "context"
http "net/http"
mock "github.com/stretchr/testify/mock"
models "github.com/ctreminiom/go-atlassian/pkg/infra/models"
)
// Connector is an autogenerated mock type for the Connector type
type Connector struct {
mock.Mock
}
// Call provides a mock function with given fields: request, structure
func (_m *Connector) Call(request *http.Request, structure interface{}) (*models.ResponseScheme, error) {
ret := _m.Called(request, structure)
var r0 *models.ResponseScheme
var r1 error
if rf, ok := ret.Get(0).(func(*http.Request, interface{}) (*models.ResponseScheme, error)); ok {
return rf(request, structure)
}
if rf, ok := ret.Get(0).(func(*http.Request, interface{}) *models.ResponseScheme); ok {
r0 = rf(request, structure)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.ResponseScheme)
}
}
if rf, ok := ret.Get(1).(func(*http.Request, interface{}) error); ok {
r1 = rf(request, structure)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewRequest provides a mock function with given fields: ctx, method, urlStr, type_, body
func (_m *Connector) NewRequest(ctx context.Context, method string, urlStr string, type_ string, body interface{}) (*http.Request, error) {
ret := _m.Called(ctx, method, urlStr, type_, body)
var r0 *http.Request
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, interface{}) (*http.Request, error)); ok {
return rf(ctx, method, urlStr, type_, body)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, interface{}) *http.Request); ok {
r0 = rf(ctx, method, urlStr, type_, body)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*http.Request)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, interface{}) error); ok {
r1 = rf(ctx, method, urlStr, type_, body)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewConnector creates a new instance of Connector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewConnector(t interface {
mock.TestingT
Cleanup(func())
}) *Connector {
mock := &Connector{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}