mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 04:20:17 +00:00
7066101996
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
36 lines
702 B
Go
36 lines
702 B
Go
// Copyright (c) Magistrala
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
|
|
auth "github.com/absmach/magistrala/auth"
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
var _ auth.KeyRepository = (*Keys)(nil)
|
|
|
|
type Keys struct {
|
|
mock.Mock
|
|
}
|
|
|
|
func (m *Keys) Save(ctx context.Context, key auth.Key) (string, error) {
|
|
ret := m.Called(ctx, key)
|
|
|
|
return ret.String(0), ret.Error(1)
|
|
}
|
|
|
|
func (m *Keys) Retrieve(ctx context.Context, issuer, id string) (auth.Key, error) {
|
|
ret := m.Called(ctx, issuer, id)
|
|
|
|
return ret.Get(0).(auth.Key), ret.Error(1)
|
|
}
|
|
|
|
func (m *Keys) Remove(ctx context.Context, issuer, id string) error {
|
|
ret := m.Called(ctx, issuer, id)
|
|
|
|
return ret.Error(0)
|
|
}
|