1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-15 17:51:01 +00:00
external-secrets/pkg/provider/alibaba/fake/fake.go

26 lines
807 B
Go
Raw Normal View History

2021-08-18 13:40:57 +00:00
package fake
import (
"fmt"
kmssdk "github.com/aliyun/alibaba-cloud-sdk-go/services/kms"
"github.com/google/go-cmp/cmp"
)
type AlibabaMockClient struct {
getSecretValue func(request *kmssdk.GetSecretValueRequest) (response *kmssdk.GetSecretValueResponse, err error)
}
func (mc *AlibabaMockClient) GetSecretValue(*kmssdk.GetSecretValueRequest) (result *kmssdk.GetSecretValueResponse, err error) {
return mc.getSecretValue(&kmssdk.GetSecretValueRequest{})
}
func (sm *AlibabaMockClient) WithValue(in *kmssdk.GetSecretValueRequest, val *kmssdk.GetSecretValueResponse, err error) {
sm.getSecretValue = func(paramIn *kmssdk.GetSecretValueRequest) (*kmssdk.GetSecretValueResponse, error) {
if !cmp.Equal(paramIn, in) {
return nil, fmt.Errorf("unexpected test argument")
}
return val, err
}
}