Commit c41cc01
authored
Add OIDC endpoint helper tests (#679)
## 🥞 Stacked PR
Use this
[link](https://github.com/databricks/databricks-sdk-java/pull/679/files)
to review incremental changes.
-
[**stack/config-auto-complete-2**](#679)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/679/files)]
-
[stack/config-auto-complete-3](#680)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/680/files/3b4e6d886efaf9fdedf7de2a5d356ea7eea18617..733d3aefce14ba9aac8ecc82e694f9c2e85fda3e)]
---------
## Summary
Adds tests covering OIDC endpoint resolution directly from a discovery
URL, exercising the existing `discoveryUrl` config field and the
`getDatabricksOidcEndpoints()` short-circuit path.
## Why
The OIDC discovery URL returned by `/.well-known/databricks-config`
points to a standard OAuth 2.0 authorization server metadata document
(`authorization_endpoint`, `token_endpoint`). The Java SDK already has
`discoveryUrl` (`DATABRICKS_DISCOVERY_URL`) and
`getDatabricksOidcEndpoints()` fetching directly from it when set — this
is the Java equivalent of the Python SDK's `get_endpoints_from_url()`
addition. This PR adds the missing test coverage for those paths.
## What changed
### Interface changes
None. The `discoveryUrl` config field (`DATABRICKS_DISCOVERY_URL`) and
the `getDatabricksOidcEndpoints()` short-circuit were already present in
the Java SDK.
### Behavioral changes
None. No existing code paths are modified.
### Internal changes
- `testDiscoveryUrlFromEnv` — verifies `DATABRICKS_DISCOVERY_URL` env
var is loaded into `discoveryUrl`.
- `testDatabricksOidcEndpointsUsesDiscoveryUrl` — verifies
`getDatabricksOidcEndpoints()` short-circuits to fetch directly from
`discoveryUrl` when set.
## How is this tested?
Unit tests in `DatabricksConfigTest` using `FixtureServer`.
NO_CHANGELOG=true1 parent 30b5035 commit c41cc01
File tree
1 file changed
+32
-0
lines changed- databricks-sdk-java/src/test/java/com/databricks/sdk/core
1 file changed
+32
-0
lines changedLines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
482 | 514 | | |
0 commit comments