toddmeng-db commented on code in PR #2799:
URL: https://github.com/apache/arrow-adbc/pull/2799#discussion_r2080126957
##########
csharp/test/Drivers/Databricks/Auth/OAuthClientCredentialsProviderTests.cs:
##########
@@ -32,13 +32,35 @@ public
OAuthClientCredentialsProviderTests(ITestOutputHelper? outputHelper)
{
}
- private OAuthClientCredentialsProvider CreateService()
+ private OAuthClientCredentialsProvider CreateService(int
refreshBufferMinutes = 5)
{
+ string host;
+ if (!string.IsNullOrEmpty(TestConfiguration.HostName))
+ {
+ host = TestConfiguration.HostName;
+ }
+ else if (!string.IsNullOrEmpty(TestConfiguration.Uri))
+ {
+ if (Uri.TryCreate(TestConfiguration.Uri, UriKind.Absolute, out
Uri? parsedUri))
+ {
+ host = parsedUri.Host;
+ }
+ else
+ {
+ throw new ArgumentException($"Invalid URI format:
{TestConfiguration.Uri}");
+ }
+ }
+ else
+ {
+ throw new ArgumentException("Either HostName or Uri must be
provided in the test configuration");
+ }
+
return new OAuthClientCredentialsProvider(
Review Comment:
can use host or URI as parameters
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]