-
Notifications
You must be signed in to change notification settings - Fork 408
/
OAuthClient.go
85 lines (67 loc) · 3.39 KB
/
OAuthClient.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
84
85
// Code generated by mockery v2.14.0. DO NOT EDIT.
package mocks
import (
apperrors "github.com/kyma-project/kyma/components/central-application-gateway/pkg/apperrors"
mock "github.com/stretchr/testify/mock"
)
// OAuthClient is an autogenerated mock type for the OAuthClient type
type OAuthClient struct {
mock.Mock
}
// GetToken provides a mock function with given fields: clientID, clientSecret, authURL, headers, queryParameters, skipTLSVerification
func (_m *OAuthClient) GetToken(clientID string, clientSecret string, authURL string, headers *map[string][]string, queryParameters *map[string][]string, skipTLSVerification bool) (string, apperrors.AppError) {
ret := _m.Called(clientID, clientSecret, authURL, headers, queryParameters, skipTLSVerification)
var r0 string
if rf, ok := ret.Get(0).(func(string, string, string, *map[string][]string, *map[string][]string, bool) string); ok {
r0 = rf(clientID, clientSecret, authURL, headers, queryParameters, skipTLSVerification)
} else {
r0 = ret.Get(0).(string)
}
var r1 apperrors.AppError
if rf, ok := ret.Get(1).(func(string, string, string, *map[string][]string, *map[string][]string, bool) apperrors.AppError); ok {
r1 = rf(clientID, clientSecret, authURL, headers, queryParameters, skipTLSVerification)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(apperrors.AppError)
}
}
return r0, r1
}
// GetTokenMTLS provides a mock function with given fields: clientID, authURL, certificate, privateKey, headers, queryParameters, skipVerify
func (_m *OAuthClient) GetTokenMTLS(clientID string, authURL string, certificate []byte, privateKey []byte, headers *map[string][]string, queryParameters *map[string][]string, skipVerify bool) (string, apperrors.AppError) {
ret := _m.Called(clientID, authURL, certificate, privateKey, headers, queryParameters, skipVerify)
var r0 string
if rf, ok := ret.Get(0).(func(string, string, []byte, []byte, *map[string][]string, *map[string][]string, bool) string); ok {
r0 = rf(clientID, authURL, certificate, privateKey, headers, queryParameters, skipVerify)
} else {
r0 = ret.Get(0).(string)
}
var r1 apperrors.AppError
if rf, ok := ret.Get(1).(func(string, string, []byte, []byte, *map[string][]string, *map[string][]string, bool) apperrors.AppError); ok {
r1 = rf(clientID, authURL, certificate, privateKey, headers, queryParameters, skipVerify)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(apperrors.AppError)
}
}
return r0, r1
}
// InvalidateTokenCache provides a mock function with given fields: clientID, clientSecret, authURL
func (_m *OAuthClient) InvalidateTokenCache(clientID string, clientSecret string, authURL string) {
_m.Called(clientID, clientSecret, authURL)
}
// InvalidateTokenCacheMTLS provides a mock function with given fields: clientID, authURL, certificate, privateKey
func (_m *OAuthClient) InvalidateTokenCacheMTLS(clientID string, authURL string, certificate []byte, privateKey []byte) {
_m.Called(clientID, authURL, certificate, privateKey)
}
type mockConstructorTestingTNewOAuthClient interface {
mock.TestingT
Cleanup(func())
}
// NewOAuthClient creates a new instance of OAuthClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewOAuthClient(t mockConstructorTestingTNewOAuthClient) *OAuthClient {
mock := &OAuthClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}