File
Blob: spec/mocks/keyless.go
| 1 | package mocks |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | |
| 6 | "go.miragespace.co/specter/spec/protocol" |
| 7 | |
| 8 | "github.com/stretchr/testify/mock" |
| 9 | ) |
| 10 | |
| 11 | type KeylessService struct { |
| 12 | mock.Mock |
| 13 | } |
| 14 | |
| 15 | func (k *KeylessService) GetCertificate(ctx context.Context, req *protocol.KeylessGetCertificateRequest) (*protocol.KeylessGetCertificateResponse, error) { |
| 16 | args := k.Called(ctx, req) |
| 17 | r := args.Get(0) |
| 18 | e := args.Error(1) |
| 19 | if e != nil { |
| 20 | return nil, e |
| 21 | } |
| 22 | return r.(*protocol.KeylessGetCertificateResponse), nil |
| 23 | } |
| 24 | |
| 25 | func (k *KeylessService) Sign(ctx context.Context, req *protocol.KeylessSignRequest) (*protocol.KeylessSignResponse, error) { |
| 26 | args := k.Called(ctx, req) |
| 27 | r := args.Get(0) |
| 28 | e := args.Error(1) |
| 29 | if e != nil { |
| 30 | return nil, e |
| 31 | } |
| 32 | return r.(*protocol.KeylessSignResponse), nil |
| 33 | } |