diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java index 51bbade9a0..8c9d2c5799 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java @@ -89,4 +89,9 @@ public boolean hasRequestMetadataOnly() { public void refresh() throws IOException { this.wrappedCredentials.refresh(); } + + @Override + public String getUniverseDomain() throws IOException { + return this.wrappedCredentials.getUniverseDomain(); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java index 9a02bd13dd..0d9d357115 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java @@ -101,4 +101,15 @@ void quotaProjectIdHidingCredentials_getAuthenticationType() throws IOException Mockito.verify(credentials, Mockito.atLeastOnce()).refresh(); } + + @Test + void quotaProjectIdHidingCredentials_getUniverseDomain() throws IOException { + Credentials credentials = Mockito.mock(GoogleCredentials.class); + Mockito.when(credentials.getUniverseDomain()).thenReturn("example.com"); + + QuotaProjectIdHidingCredentials quotaProjectIdHidingCredentials = + new QuotaProjectIdHidingCredentials(credentials); + + assertEquals(quotaProjectIdHidingCredentials.getUniverseDomain(), "example.com"); + } }