Bring some tests up to match some current changes.

Change-Id: I741fc5df06f9fa06cf15dd04cba3ff9fbb90e880
This commit is contained in:
Patrick Jones
2021-01-07 16:35:06 -08:00
parent 1555f5377f
commit c37859f59d
2 changed files with 4 additions and 3 deletions

View File

@@ -14,7 +14,8 @@ import (
)
var testBaseCredSource = CredentialSource{
File: "internalTestingFile",
File: "./testdata/3pi_cred.txt",
Format: format{Type: fileTypeText},
}
var testConfig = Config{
@@ -29,7 +30,7 @@ var testConfig = Config{
}
var (
baseCredsRequestBody = "audience=32555940559.apps.googleusercontent.com&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&options=null&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control&subject_token=Sample.Subject.Token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Ajwt"
baseCredsRequestBody = "audience=32555940559.apps.googleusercontent.com&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&options=null&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control&subject_token=street123&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Ajwt"
baseCredsResponseBody = `{"access_token":"Sample.Access.Token","issued_token_type":"urn:ietf:params:oauth:token-type:access_token","token_type":"Bearer","expires_in":3600,"scope":"https://www.googleapis.com/auth/cloud-platform"}`
correctAT = "Sample.Access.Token"
expiry int64 = 234852

View File

@@ -53,7 +53,7 @@ func TestRetrieveFileSubjectToken(t *testing.T) {
tfc := testFileConfig
tfc.CredentialSource = test.cs
out, err := tfc.parse().retrieveSubjectToken(&tfc)
out, err := tfc.parse().subjectToken()
if err != nil {
t.Errorf("Method retrieveSubjectToken for type fileCredentialSource in test %v failed; %e", test.name, err)
}