Change-Id: Ie9d82a9c162eb72f63ebd75a284083eb4318d6d1
This commit is contained in:
Patrick Jones
2021-01-12 13:02:21 -08:00
parent bf1e0506de
commit 3454980053
3 changed files with 22 additions and 26 deletions

View File

@@ -13,8 +13,6 @@ import (
var myURLToken = "testTokenValue"
func TestRetrieveURLSubjectToken_Text(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -24,7 +22,7 @@ func TestRetrieveURLSubjectToken_Text(t *testing.T) {
w.Write([]byte("testTokenValue"))
}))
cs := CredentialSource{
URL: ts.URL,
URL: ts.URL,
Format: format{Type: fileTypeText},
}
tfc := testFileConfig
@@ -81,7 +79,7 @@ func TestRetrieveURLSubjectToken_JSON(t *testing.T) {
w.Write(jsonResp)
}))
cs := CredentialSource{
URL: ts.URL,
URL: ts.URL,
Format: format{Type: fileTypeJSON, SubjectTokenFieldName: "SubjToken"},
}
tfc := testFileConfig
@@ -89,7 +87,6 @@ func TestRetrieveURLSubjectToken_JSON(t *testing.T) {
out, err := tfc.parse().subjectToken()
if err != nil {
t.Fatalf("%v", err)
}
@@ -97,4 +94,4 @@ func TestRetrieveURLSubjectToken_JSON(t *testing.T) {
t.Errorf("got %v but want %v", out, myURLToken)
}
}
}