github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/runtime/automock/runtime_service.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package automock 4 5 import ( 6 context "context" 7 8 labelfilter "github.com/kyma-incubator/compass/components/director/internal/labelfilter" 9 mock "github.com/stretchr/testify/mock" 10 11 model "github.com/kyma-incubator/compass/components/director/internal/model" 12 ) 13 14 // RuntimeService is an autogenerated mock type for the RuntimeService type 15 type RuntimeService struct { 16 mock.Mock 17 } 18 19 // CreateWithMandatoryLabels provides a mock function with given fields: ctx, in, id, mandatoryLabels 20 func (_m *RuntimeService) CreateWithMandatoryLabels(ctx context.Context, in model.RuntimeRegisterInput, id string, mandatoryLabels map[string]interface{}) error { 21 ret := _m.Called(ctx, in, id, mandatoryLabels) 22 23 var r0 error 24 if rf, ok := ret.Get(0).(func(context.Context, model.RuntimeRegisterInput, string, map[string]interface{}) error); ok { 25 r0 = rf(ctx, in, id, mandatoryLabels) 26 } else { 27 r0 = ret.Error(0) 28 } 29 30 return r0 31 } 32 33 // Delete provides a mock function with given fields: ctx, id 34 func (_m *RuntimeService) Delete(ctx context.Context, id string) error { 35 ret := _m.Called(ctx, id) 36 37 var r0 error 38 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 39 r0 = rf(ctx, id) 40 } else { 41 r0 = ret.Error(0) 42 } 43 44 return r0 45 } 46 47 // DeleteLabel provides a mock function with given fields: ctx, runtimeID, key 48 func (_m *RuntimeService) DeleteLabel(ctx context.Context, runtimeID string, key string) error { 49 ret := _m.Called(ctx, runtimeID, key) 50 51 var r0 error 52 if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { 53 r0 = rf(ctx, runtimeID, key) 54 } else { 55 r0 = ret.Error(0) 56 } 57 58 return r0 59 } 60 61 // Get provides a mock function with given fields: ctx, id 62 func (_m *RuntimeService) Get(ctx context.Context, id string) (*model.Runtime, error) { 63 ret := _m.Called(ctx, id) 64 65 var r0 *model.Runtime 66 if rf, ok := ret.Get(0).(func(context.Context, string) *model.Runtime); ok { 67 r0 = rf(ctx, id) 68 } else { 69 if ret.Get(0) != nil { 70 r0 = ret.Get(0).(*model.Runtime) 71 } 72 } 73 74 var r1 error 75 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 76 r1 = rf(ctx, id) 77 } else { 78 r1 = ret.Error(1) 79 } 80 81 return r0, r1 82 } 83 84 // GetByFilters provides a mock function with given fields: ctx, filters 85 func (_m *RuntimeService) GetByFilters(ctx context.Context, filters []*labelfilter.LabelFilter) (*model.Runtime, error) { 86 ret := _m.Called(ctx, filters) 87 88 var r0 *model.Runtime 89 if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter) *model.Runtime); ok { 90 r0 = rf(ctx, filters) 91 } else { 92 if ret.Get(0) != nil { 93 r0 = ret.Get(0).(*model.Runtime) 94 } 95 } 96 97 var r1 error 98 if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter) error); ok { 99 r1 = rf(ctx, filters) 100 } else { 101 r1 = ret.Error(1) 102 } 103 104 return r0, r1 105 } 106 107 // GetByTokenIssuer provides a mock function with given fields: ctx, issuer 108 func (_m *RuntimeService) GetByTokenIssuer(ctx context.Context, issuer string) (*model.Runtime, error) { 109 ret := _m.Called(ctx, issuer) 110 111 var r0 *model.Runtime 112 if rf, ok := ret.Get(0).(func(context.Context, string) *model.Runtime); ok { 113 r0 = rf(ctx, issuer) 114 } else { 115 if ret.Get(0) != nil { 116 r0 = ret.Get(0).(*model.Runtime) 117 } 118 } 119 120 var r1 error 121 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 122 r1 = rf(ctx, issuer) 123 } else { 124 r1 = ret.Error(1) 125 } 126 127 return r0, r1 128 } 129 130 // GetLabel provides a mock function with given fields: ctx, runtimeID, key 131 func (_m *RuntimeService) GetLabel(ctx context.Context, runtimeID string, key string) (*model.Label, error) { 132 ret := _m.Called(ctx, runtimeID, key) 133 134 var r0 *model.Label 135 if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Label); ok { 136 r0 = rf(ctx, runtimeID, key) 137 } else { 138 if ret.Get(0) != nil { 139 r0 = ret.Get(0).(*model.Label) 140 } 141 } 142 143 var r1 error 144 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 145 r1 = rf(ctx, runtimeID, key) 146 } else { 147 r1 = ret.Error(1) 148 } 149 150 return r0, r1 151 } 152 153 // List provides a mock function with given fields: ctx, filter, pageSize, cursor 154 func (_m *RuntimeService) List(ctx context.Context, filter []*labelfilter.LabelFilter, pageSize int, cursor string) (*model.RuntimePage, error) { 155 ret := _m.Called(ctx, filter, pageSize, cursor) 156 157 var r0 *model.RuntimePage 158 if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter, int, string) *model.RuntimePage); ok { 159 r0 = rf(ctx, filter, pageSize, cursor) 160 } else { 161 if ret.Get(0) != nil { 162 r0 = ret.Get(0).(*model.RuntimePage) 163 } 164 } 165 166 var r1 error 167 if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter, int, string) error); ok { 168 r1 = rf(ctx, filter, pageSize, cursor) 169 } else { 170 r1 = ret.Error(1) 171 } 172 173 return r0, r1 174 } 175 176 // ListLabels provides a mock function with given fields: ctx, runtimeID 177 func (_m *RuntimeService) ListLabels(ctx context.Context, runtimeID string) (map[string]*model.Label, error) { 178 ret := _m.Called(ctx, runtimeID) 179 180 var r0 map[string]*model.Label 181 if rf, ok := ret.Get(0).(func(context.Context, string) map[string]*model.Label); ok { 182 r0 = rf(ctx, runtimeID) 183 } else { 184 if ret.Get(0) != nil { 185 r0 = ret.Get(0).(map[string]*model.Label) 186 } 187 } 188 189 var r1 error 190 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 191 r1 = rf(ctx, runtimeID) 192 } else { 193 r1 = ret.Error(1) 194 } 195 196 return r0, r1 197 } 198 199 // SetLabel provides a mock function with given fields: ctx, label 200 func (_m *RuntimeService) SetLabel(ctx context.Context, label *model.LabelInput) error { 201 ret := _m.Called(ctx, label) 202 203 var r0 error 204 if rf, ok := ret.Get(0).(func(context.Context, *model.LabelInput) error); ok { 205 r0 = rf(ctx, label) 206 } else { 207 r0 = ret.Error(0) 208 } 209 210 return r0 211 } 212 213 // UnsafeExtractModifiableLabels provides a mock function with given fields: labels 214 func (_m *RuntimeService) UnsafeExtractModifiableLabels(labels map[string]interface{}) (map[string]interface{}, error) { 215 ret := _m.Called(labels) 216 217 var r0 map[string]interface{} 218 if rf, ok := ret.Get(0).(func(map[string]interface{}) map[string]interface{}); ok { 219 r0 = rf(labels) 220 } else { 221 if ret.Get(0) != nil { 222 r0 = ret.Get(0).(map[string]interface{}) 223 } 224 } 225 226 var r1 error 227 if rf, ok := ret.Get(1).(func(map[string]interface{}) error); ok { 228 r1 = rf(labels) 229 } else { 230 r1 = ret.Error(1) 231 } 232 233 return r0, r1 234 } 235 236 // Update provides a mock function with given fields: ctx, id, in 237 func (_m *RuntimeService) Update(ctx context.Context, id string, in model.RuntimeUpdateInput) error { 238 ret := _m.Called(ctx, id, in) 239 240 var r0 error 241 if rf, ok := ret.Get(0).(func(context.Context, string, model.RuntimeUpdateInput) error); ok { 242 r0 = rf(ctx, id, in) 243 } else { 244 r0 = ret.Error(0) 245 } 246 247 return r0 248 } 249 250 type mockConstructorTestingTNewRuntimeService interface { 251 mock.TestingT 252 Cleanup(func()) 253 } 254 255 // NewRuntimeService creates a new instance of RuntimeService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 256 func NewRuntimeService(t mockConstructorTestingTNewRuntimeService) *RuntimeService { 257 mock := &RuntimeService{} 258 mock.Mock.Test(t) 259 260 t.Cleanup(func() { mock.AssertExpectations(t) }) 261 262 return mock 263 }