diff --git a/backend_test.go b/backend_test.go index 7d22cbdb..6dd1f037 100644 --- a/backend_test.go +++ b/backend_test.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/go-hclog" log "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/sdk/helper/logging" + "github.com/hashicorp/vault/sdk/helper/pluginutil" "github.com/hashicorp/vault/sdk/logical" ) @@ -26,15 +27,23 @@ var ( testClientSecret = "testClientSecret" ) +type testSystemViewEnt struct { + logical.StaticSystemView +} + +func (d testSystemViewEnt) GenerateIdentityToken(_ context.Context, _ *pluginutil.IdentityTokenRequest) (*pluginutil.IdentityTokenResponse, error) { + return &pluginutil.IdentityTokenResponse{}, nil +} + func getTestBackendMocked(t *testing.T, initConfig bool) (*azureSecretBackend, logical.Storage) { b := backend() + sysView := testSystemViewEnt{} + sysView.DefaultLeaseTTLVal = defaultLeaseTTLHr + sysView.MaxLeaseTTLVal = maxLeaseTTLHr config := &logical.BackendConfig{ - Logger: logging.NewVaultLogger(log.Trace), - System: &logical.StaticSystemView{ - DefaultLeaseTTLVal: defaultLeaseTTLHr, - MaxLeaseTTLVal: maxLeaseTTLHr, - }, + Logger: logging.NewVaultLogger(log.Trace), + System: &sysView, StorageView: &logical.InmemStorage{}, } err := b.Setup(context.Background(), config)