Files
supermq/auth/mocks/keys.go
T
Dušan Borovčanin be9bc22df4 NOISSUE - Update CI tools (#2314)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-06-25 13:45:11 +02:00

107 lines
2.5 KiB
Go

// Code generated by mockery v2.43.2. DO NOT EDIT.
// Copyright (c) Abstract Machines
package mocks
import (
context "context"
auth "github.com/absmach/magistrala/auth"
mock "github.com/stretchr/testify/mock"
)
// KeyRepository is an autogenerated mock type for the KeyRepository type
type KeyRepository struct {
mock.Mock
}
// Remove provides a mock function with given fields: ctx, issuer, id
func (_m *KeyRepository) Remove(ctx context.Context, issuer string, id string) error {
ret := _m.Called(ctx, issuer, id)
if len(ret) == 0 {
panic("no return value specified for Remove")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
r0 = rf(ctx, issuer, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// Retrieve provides a mock function with given fields: ctx, issuer, id
func (_m *KeyRepository) Retrieve(ctx context.Context, issuer string, id string) (auth.Key, error) {
ret := _m.Called(ctx, issuer, id)
if len(ret) == 0 {
panic("no return value specified for Retrieve")
}
var r0 auth.Key
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (auth.Key, error)); ok {
return rf(ctx, issuer, id)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) auth.Key); ok {
r0 = rf(ctx, issuer, id)
} else {
r0 = ret.Get(0).(auth.Key)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, issuer, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Save provides a mock function with given fields: ctx, key
func (_m *KeyRepository) Save(ctx context.Context, key auth.Key) (string, error) {
ret := _m.Called(ctx, key)
if len(ret) == 0 {
panic("no return value specified for Save")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, auth.Key) (string, error)); ok {
return rf(ctx, key)
}
if rf, ok := ret.Get(0).(func(context.Context, auth.Key) string); ok {
r0 = rf(ctx, key)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, auth.Key) error); ok {
r1 = rf(ctx, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewKeyRepository creates a new instance of KeyRepository. 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 NewKeyRepository(t interface {
mock.TestingT
Cleanup(func())
}) *KeyRepository {
mock := &KeyRepository{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}