Skip to content

Commit d005709

Browse files
committed
refactor: rename getApiAudienceString to getGdchAudience
1 parent 6d713fe commit d005709

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

oauth2_http/java/com/google/auth/oauth2/GdchCredentials.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,18 +388,18 @@ public final URI getTokenServerUri() {
388388
*
389389
* @return the audience string
390390
*/
391-
public final String getApiAudienceString() {
391+
public final String getGdchAudience() {
392392
return apiAudience;
393393
}
394394

395395
/**
396-
* NOTE: This method is obsolete, please use getApiAudienceString() instead. Returns a URI
396+
* NOTE: This method is obsolete, please use getGdchAudience() instead. Returns a URI
397397
* representation of the underlying audience string set for this credentials object. This method
398398
* may fail if the underlying audience string does not conform to a URI format.
399399
*
400400
* @return a URI object representing the audience of the credentials
401401
*/
402-
@ObsoleteApi("Use getApiAudienceString() instead.")
402+
@ObsoleteApi("Use getGdchAudience() instead.")
403403
public final URI getApiAudience() {
404404
if (Strings.isNullOrEmpty(apiAudience)) {
405405
return null;

oauth2_http/javatests/com/google/auth/oauth2/GdchCredentialsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ void createWithGdchAudience_correct() throws IOException {
505505
assertEquals(SERVICE_IDENTITY_NAME, gdchWithAudience.getServiceIdentityName());
506506
assertEquals(TOKEN_SERVER_URI, gdchWithAudience.getTokenServerUri());
507507
assertEquals(CA_CERT_PATH, credentials.getCaCertPath());
508-
assertEquals(API_AUDIENCE, gdchWithAudience.getApiAudienceString());
508+
assertEquals(API_AUDIENCE, gdchWithAudience.getGdchAudience());
509509
}
510510

511511
@Test
@@ -549,7 +549,7 @@ void createWithGdchAudience_emptyApiAudience() throws IOException {
549549
}
550550

551551
@Test
552-
void getApiAudienceString_vs_getApiAudience() throws IOException {
552+
void getGdchAudience_vs_getApiAudience() throws IOException {
553553
GenericJson json =
554554
writeGdchServiceAccountJson(
555555
FORMAT_VERSION,
@@ -563,12 +563,12 @@ void getApiAudienceString_vs_getApiAudience() throws IOException {
563563

564564
String validUri = "https://valid-audience.com";
565565
GdchCredentials validCredentials = credentials.createWithGdchAudience(validUri);
566-
assertEquals(validUri, validCredentials.getApiAudienceString());
566+
assertEquals(validUri, validCredentials.getGdchAudience());
567567
assertEquals(URI.create(validUri), validCredentials.getApiAudience());
568568

569569
String invalidUri = "invalid uri ^";
570570
GdchCredentials invalidCredentials = credentials.createWithGdchAudience(invalidUri);
571-
assertEquals(invalidUri, invalidCredentials.getApiAudienceString());
571+
assertEquals(invalidUri, invalidCredentials.getGdchAudience());
572572
assertNull(invalidCredentials.getApiAudience());
573573
}
574574

0 commit comments

Comments
 (0)