certificates/cas/vaultcas/auth/kubernetes/kubernetes_test.go
2022-05-21 21:06:15 +02:00

21 lines
455 B
Go

package kubernetes
import (
"encoding/json"
"path"
"path/filepath"
"runtime"
"testing"
)
func TestKubernetes_NewKubernetesAuthMethod(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)
tokenPath := filepath.Join(path.Dir(filename), "token")
mountPath := "kubernetes"
raw := `{"role": "SomeRoleName", "tokenPath": "` + tokenPath + `"}`
_, err := NewKubernetesAuthMethod(mountPath, json.RawMessage(raw))
if err != nil {
t.Fatal(err)
}
}