Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private InputStream getUserCredentialsStream() throws IOException {
json.put("client_secret", clientSecret);
}
if (quotaProjectId != null) {
json.put("quota_project", clientSecret);
json.put("quota_project_id", quotaProjectId);
}
json.setFactory(JSON_FACTORY);
String text = json.toPrettyString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ void getDefaultCredentials_GdchServiceAccount() throws IOException {
assertNotNull(((GdchCredentials) defaultCredentials).getApiAudience());
}

@Test
void getDefaultCredentials_quota_project() throws IOException {
InputStream userStream =
UserCredentialsTest.writeUserStream(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ void saveAndRestoreUserCredential_saveAndRestored_doesNotThrow() throws IOExcept
.setClientId(CLIENT_ID)
.setClientSecret(CLIENT_SECRET)
.setRefreshToken(REFRESH_TOKEN)
.setQuotaProjectId(QUOTA_PROJECT)
.build();

File file = File.createTempFile("GOOGLE_APPLICATION_CREDENTIALS", null, null);
Expand All @@ -649,6 +650,7 @@ void saveAndRestoreUserCredential_saveAndRestored_doesNotThrow() throws IOExcept
assertEquals(userCredentials.getClientId(), restoredCredentials.getClientId());
assertEquals(userCredentials.getClientSecret(), restoredCredentials.getClientSecret());
assertEquals(userCredentials.getRefreshToken(), restoredCredentials.getRefreshToken());
assertEquals(userCredentials.getQuotaProjectId(), restoredCredentials.getQuotaProjectId());
}
}

Expand Down
Loading