Skip to content

Commit 1e064bb

Browse files
committed
fixed failing existing test
1 parent f4ef85c commit 1e064bb

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/ExternalBrowserCredentialsProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public OAuthHeaderFactory configure(DatabricksConfig config) {
8787
.setToken(cachedToken)
8888
.setAsyncDisabled(config.getDisableAsyncTokenRefresh())
8989
.build();
90-
LOGGER.debug("Using cached token, will immediately refresh");
90+
LOGGER.debug("Using cached token, will refresh if necessary");
9191
cachedTokenSource.getToken();
9292
return OAuthHeaderFactory.fromTokenSource(cachedTokenSource);
9393
} catch (Exception e) {

databricks-sdk-java/src/test/java/com/databricks/sdk/core/oauth/ExternalBrowserCredentialsProviderTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,12 @@ void cacheWithValidTokenTest() throws IOException {
269269
// We need to provide OIDC endpoints
270270
OpenIDConnectEndpoints endpoints =
271271
new OpenIDConnectEndpoints(
272-
"https://test.databricks.com/token", "https://test.databricks.com/authorize");
272+
"https://test.databricks.com/oidc/v1/token",
273+
"https://test.databricks.com/oidc/v1/authorize");
273274

274275
// Create our provider with the mock token cache
275276
ExternalBrowserCredentialsProvider provider =
276-
new ExternalBrowserCredentialsProvider(mockTokenCache);
277+
Mockito.spy(new ExternalBrowserCredentialsProvider(mockTokenCache));
277278

278279
// Spy on the config to inject the endpoints
279280
DatabricksConfig spyConfig = Mockito.spy(config);
@@ -339,7 +340,8 @@ void cacheWithInvalidAccessTokenValidRefreshTest() throws IOException {
339340
// We need to provide OIDC endpoints for token refresh
340341
OpenIDConnectEndpoints endpoints =
341342
new OpenIDConnectEndpoints(
342-
"https://test.databricks.com/token", "https://test.databricks.com/authorize");
343+
"https://test.databricks.com/oidc/v1/token",
344+
"https://test.databricks.com/oidc/v1/authorize");
343345

344346
// Create our provider with the mock token cache
345347
ExternalBrowserCredentialsProvider provider =
@@ -438,7 +440,8 @@ void cacheWithInvalidAccessTokenRefreshFailingTest() throws IOException {
438440
// We need to provide OIDC endpoints for token refresh attempt
439441
OpenIDConnectEndpoints endpoints =
440442
new OpenIDConnectEndpoints(
441-
"https://test.databricks.com/token", "https://test.databricks.com/authorize");
443+
"https://test.databricks.com/oidc/v1/token",
444+
"https://test.databricks.com/oidc/v1/authorize");
442445

443446
// Create our provider and mock the browser auth method
444447
ExternalBrowserCredentialsProvider provider =

0 commit comments

Comments
 (0)