-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
backend_test.go
27 lines (23 loc) · 842 Bytes
/
backend_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package gitlab_test
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
gitlab "github.com/ilijamt/vault-plugin-secrets-gitlab"
)
func TestBackend(t *testing.T) {
var err error
var b *gitlab.Backend
ctx := getCtxGitlabClient(t)
b, _, err = getBackend(ctx)
require.NoError(t, err)
require.NotNil(t, b)
require.Nil(t, b.GetClient(gitlab.DefaultConfigName))
b.SetClient(newInMemoryClient(true), gitlab.DefaultConfigName)
require.NotNil(t, b.GetClient(gitlab.DefaultConfigName))
b.Invalidate(ctx, fmt.Sprintf("%s/%s", gitlab.PathConfigStorage, gitlab.DefaultConfigName))
require.Nil(t, b.GetClient(gitlab.DefaultConfigName))
b.SetClient(newInMemoryClient(true), gitlab.DefaultConfigName)
require.NotNil(t, b.GetClient(gitlab.DefaultConfigName))
require.EqualValues(t, gitlab.Version, b.PluginVersion().Version)
}