certificates/cas/vaultcas/auth/kubernetes/kubernetes_test.go

22 lines
455 B
Go
Raw Normal View History

2022-05-09 11:27:37 +00:00
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)
}
}