Fixed nits from Cody.

Change-Id: I037f7313217d75f29f7150c53c1cd28a0ec7ea35
This commit is contained in:
Patrick Jones
2021-02-11 13:15:22 -08:00
parent 483d2860a6
commit 3cb804a538
5 changed files with 16 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ package externalaccount
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"testing"
@@ -19,11 +20,18 @@ func TestRetrieveURLSubjectToken_Text(t *testing.T) {
if r.Method != "GET" {
t.Errorf("Unexpected request method, %v is found", r.Method)
}
fmt.Println(r.Header)
if r.Header.Get("Metadata") != "True" {
t.Errorf("Metadata header not properly included.")
}
w.Write([]byte("testTokenValue"))
}))
heads := make(map[string]string)
heads["Metadata"] = "True"
cs := CredentialSource{
URL: ts.URL,
Format: format{Type: fileTypeText},
Headers: heads,
}
tfc := testFileConfig
tfc.CredentialSource = cs