OIDCKeyService.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 "bnema.dev/ermite/internal/ports"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewOIDCKeyService creates a new instance of OIDCKeyService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
16// The first argument is typically a *testing.T value.
17func NewOIDCKeyService(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *OIDCKeyService {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &OIDCKeyService{}
26 mock.Mock.Test(t)
27
28 t.Cleanup(func() {
29 if helper, ok := t.(interface{ Helper() }); ok {
30 helper.Helper()
31 }
32 mock.AssertExpectations(t)
33 })
34
35 return mock
36}
37
38// OIDCKeyService is an autogenerated mock type for the OIDCKeyService type
39type OIDCKeyService struct {
40 mock.Mock
41}
42
43type OIDCKeyService_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *OIDCKeyService) EXPECT() *OIDCKeyService_Expecter {
48 return &OIDCKeyService_Expecter{mock: &_m.Mock}
49}
50
51// RotateKey provides a mock function for the type OIDCKeyService
52func (_mock *OIDCKeyService) RotateKey(ctx context.Context, p domain.Principal) (ports.OIDCRotation, error) {
53 ret := _mock.Called(ctx, p)
54
55 if len(ret) == 0 {
56 panic("no return value specified for RotateKey")
57 }
58
59 var r0 ports.OIDCRotation
60 var r1 error
61 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) (ports.OIDCRotation, error)); ok {
62 return returnFunc(ctx, p)
63 }
64 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) ports.OIDCRotation); ok {
65 r0 = returnFunc(ctx, p)
66 } else {
67 r0 = ret.Get(0).(ports.OIDCRotation)
68 }
69 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok {
70 r1 = returnFunc(ctx, p)
71 } else {
72 r1 = ret.Error(1)
73 }
74 return r0, r1
75}
76
77// OIDCKeyService_RotateKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RotateKey'
78type OIDCKeyService_RotateKey_Call struct {
79 *mock.Call
80}
81
82// RotateKey is a helper method to define mock.On call
83// - ctx context.Context
84// - p domain.Principal
85func (_e *OIDCKeyService_Expecter) RotateKey(ctx any, p any) *OIDCKeyService_RotateKey_Call {
86 return &OIDCKeyService_RotateKey_Call{Call: _e.mock.On("RotateKey", ctx, p)}
87}
88
89func (_c *OIDCKeyService_RotateKey_Call) Run(run func(ctx context.Context, p domain.Principal)) *OIDCKeyService_RotateKey_Call {
90 _c.Call.Run(func(args mock.Arguments) {
91 var arg0 context.Context
92 if args[0] != nil {
93 arg0 = args[0].(context.Context)
94 }
95 var arg1 domain.Principal
96 if args[1] != nil {
97 arg1 = args[1].(domain.Principal)
98 }
99 run(
100 arg0,
101 arg1,
102 )
103 })
104 return _c
105}
106
107func (_c *OIDCKeyService_RotateKey_Call) Return(oIDCRotation ports.OIDCRotation, err error) *OIDCKeyService_RotateKey_Call {
108 _c.Call.Return(oIDCRotation, err)
109 return _c
110}
111
112func (_c *OIDCKeyService_RotateKey_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) (ports.OIDCRotation, error)) *OIDCKeyService_RotateKey_Call {
113 _c.Call.Return(run)
114 return _c
115}