-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Universe Domain Environment Variable Support #2485
Changes from 13 commits
0f7e7a3
c61320d
b5aa5c0
87251a9
41165ec
2afc321
fb6c183
1e376f1
b214eea
60c5b35
287fd72
eecca91
2b4edbc
112e790
52b065a
7d36b39
363f0ef
c4a6b7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,6 +340,21 @@ public void endpointContextBuild_gdchFlow_noUniverseDomain_customEndpoint() thro | |
.isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); | ||
} | ||
|
||
// This Universe Domain should match the `GOOGLE_CLOUD_UNIVERSE_DOMAIN` Env Var | ||
// For this test running locally or in CI, check that the Env Var is set properly. | ||
// This test should only run when the maven profile `EnvVarTest` is enabled. | ||
@Test | ||
public void endpointContextBuild_universeDomainEnvVarSet() throws IOException { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add one more test case that if universe domain is set on both ClientSettings and Env Var, then ClientSettings should take precedence. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, added a test case that will be run with |
||
String envVarUniverseDomain = "random.com"; | ||
EndpointContext endpointContext = | ||
defaultEndpointContextBuilder | ||
.setUniverseDomain(null) | ||
.setClientSettingsEndpoint(null) | ||
.build(); | ||
Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo("test.random.com:443"); | ||
Truth.assertThat(endpointContext.resolvedUniverseDomain()).isEqualTo(envVarUniverseDomain); | ||
} | ||
|
||
@Test | ||
public void hasValidUniverseDomain_gdchFlow_anyCredentials() throws IOException { | ||
Credentials noCredentials = NoCredentialsProvider.create().getCredentials(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the logic to
determineUniverseDomain()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, moved it to
determineUniverseDomain()