File tree Expand file tree Collapse file tree 4 files changed +112
-0
lines changed
databricks-sdk-java/src/test/java/com/databricks/sdk/integration Expand file tree Collapse file tree 4 files changed +112
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .databricks .sdk .integration ;
2+
3+ import com .databricks .sdk .AccountClient ;
4+ import com .databricks .sdk .core .oauth .OpenIDConnectEndpoints ;
5+ import com .databricks .sdk .integration .framework .EnvContext ;
6+ import com .databricks .sdk .integration .framework .EnvTest ;
7+
8+ import java .io .IOException ;
9+ import org .junit .jupiter .api .Test ;
10+ import org .junit .jupiter .api .extension .ExtendWith ;
11+
12+
13+ @ EnvContext ("account" )
14+ @ ExtendWith (EnvTest .class )
15+ public class OidcAccountEndpointIT {
16+ @ Test
17+ void lists (AccountClient a ) throws IOException {
18+ OpenIDConnectEndpoints endpoints = a .config ().getOidcEndpoints ();
19+ String host = a .config ().getHost ();
20+ String accountId = a .config ().getAccountId ();
21+ if (a .config ().isAzure ()) {
22+ assert endpoints .getAuthorizationEndpoint ().equals (host + "/oidc/v1/authorize" );
23+ assert endpoints .getTokenEndpoint ().equals (host + "/oidc/v1/token" );
24+ } else {
25+ assert endpoints .getAuthorizationEndpoint ().equals (host + "/oidc/accounts/" + accountId + "/v1/authorize" );
26+ assert endpoints .getTokenEndpoint ().equals (host + "/oidc/accounts/" + accountId + "/v1/token" );
27+ }
28+ }
29+
30+
31+ }
Original file line number Diff line number Diff line change 1+ package com .databricks .sdk .integration ;
2+
3+ import com .databricks .sdk .AccountClient ;
4+ import com .databricks .sdk .core .oauth .OpenIDConnectEndpoints ;
5+ import com .databricks .sdk .integration .framework .EnvContext ;
6+ import com .databricks .sdk .integration .framework .EnvTest ;
7+
8+ import java .io .IOException ;
9+ import org .junit .jupiter .api .Test ;
10+ import org .junit .jupiter .api .extension .ExtendWith ;
11+
12+
13+ @ EnvContext ("ucacct" )
14+ @ ExtendWith (EnvTest .class )
15+ public class OidcUcAccountEndpointIT {
16+ @ Test
17+ void lists (AccountClient a ) throws IOException {
18+ OpenIDConnectEndpoints endpoints = a .config ().getOidcEndpoints ();
19+ String host = a .config ().getHost ();
20+ String accountId = a .config ().getAccountId ();
21+ if (a .config ().isAzure ()) {
22+ assert endpoints .getAuthorizationEndpoint ().equals (host + "/oidc/v1/authorize" );
23+ assert endpoints .getTokenEndpoint ().equals (host + "/oidc/v1/token" );
24+ } else {
25+ assert endpoints .getAuthorizationEndpoint ().equals (host + "/oidc/accounts/" + accountId + "/v1/authorize" );
26+ assert endpoints .getTokenEndpoint ().equals (host + "/oidc/accounts/" + accountId + "/v1/token" );
27+ }
28+ }
29+
30+
31+ }
Original file line number Diff line number Diff line change 1+ package com .databricks .sdk .integration ;
2+
3+ import com .databricks .sdk .WorkspaceClient ;
4+ import com .databricks .sdk .core .oauth .OpenIDConnectEndpoints ;
5+ import com .databricks .sdk .integration .framework .EnvContext ;
6+ import com .databricks .sdk .integration .framework .EnvTest ;
7+
8+ import java .io .IOException ;
9+ import org .junit .jupiter .api .Test ;
10+ import org .junit .jupiter .api .extension .ExtendWith ;
11+
12+
13+ @ EnvContext ("ucws" )
14+ @ ExtendWith (EnvTest .class )
15+ public class OidcUcWorkspaceEndpointIT {
16+ @ Test
17+ void lists (WorkspaceClient w ) throws IOException {
18+ OpenIDConnectEndpoints endpoints = w .config ().getOidcEndpoints ();
19+ String host = w .config ().getHost ();
20+ assert endpoints .getAuthorizationEndpoint ().equals (host + "/oidc/v1/authorize" );
21+ assert endpoints .getTokenEndpoint ().equals (host + "/oidc/v1/token" );
22+ }
23+
24+
25+ }
Original file line number Diff line number Diff line change 1+ package com .databricks .sdk .integration ;
2+
3+ import com .databricks .sdk .WorkspaceClient ;
4+ import com .databricks .sdk .core .oauth .OpenIDConnectEndpoints ;
5+ import com .databricks .sdk .integration .framework .EnvContext ;
6+ import com .databricks .sdk .integration .framework .EnvTest ;
7+
8+ import java .io .IOException ;
9+ import org .junit .jupiter .api .Test ;
10+ import org .junit .jupiter .api .extension .ExtendWith ;
11+
12+
13+ @ EnvContext ("workspace" )
14+ @ ExtendWith (EnvTest .class )
15+ public class OidcWorkspaceEndpointIT {
16+ @ Test
17+ void lists (WorkspaceClient w ) throws IOException {
18+ OpenIDConnectEndpoints endpoints = w .config ().getOidcEndpoints ();
19+ String host = w .config ().getHost ();
20+ assert endpoints .getAuthorizationEndpoint ().equals (host + "/oidc/v1/authorize" );
21+ assert endpoints .getTokenEndpoint ().equals (host + "/oidc/v1/token" );
22+ }
23+
24+
25+ }
You can’t perform that action at this time.
0 commit comments