forked from remote/oauth2
Bring some tests up to match some current changes.
Change-Id: I741fc5df06f9fa06cf15dd04cba3ff9fbb90e880
This commit is contained in:
@@ -14,7 +14,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var testBaseCredSource = CredentialSource{
|
var testBaseCredSource = CredentialSource{
|
||||||
File: "internalTestingFile",
|
File: "./testdata/3pi_cred.txt",
|
||||||
|
Format: format{Type: fileTypeText},
|
||||||
}
|
}
|
||||||
|
|
||||||
var testConfig = Config{
|
var testConfig = Config{
|
||||||
@@ -29,7 +30,7 @@ var testConfig = Config{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
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"}`
|
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"
|
correctAT = "Sample.Access.Token"
|
||||||
expiry int64 = 234852
|
expiry int64 = 234852
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ func TestRetrieveFileSubjectToken(t *testing.T) {
|
|||||||
tfc := testFileConfig
|
tfc := testFileConfig
|
||||||
tfc.CredentialSource = test.cs
|
tfc.CredentialSource = test.cs
|
||||||
|
|
||||||
out, err := tfc.parse().retrieveSubjectToken(&tfc)
|
out, err := tfc.parse().subjectToken()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Method retrieveSubjectToken for type fileCredentialSource in test %v failed; %e", test.name, err)
|
t.Errorf("Method retrieveSubjectToken for type fileCredentialSource in test %v failed; %e", test.name, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user