@@ -99,6 +99,7 @@ public void testToStringWithEnv() {
9999 public void testWorkspaceLevelOidcEndpointsWithAccountId () throws IOException {
100100 try (FixtureServer server =
101101 new FixtureServer ()
102+ .with ("GET" , "/.well-known/databricks-config" , "{}" , 404 )
102103 .with (
103104 "GET" ,
104105 "/oidc/.well-known/oauth-authorization-server" ,
@@ -118,6 +119,7 @@ public void testWorkspaceLevelOidcEndpointsWithAccountId() throws IOException {
118119 public void testWorkspaceLevelOidcEndpointsRetries () throws IOException {
119120 try (FixtureServer server =
120121 new FixtureServer ()
122+ .with ("GET" , "/.well-known/databricks-config" , "{}" , 404 )
121123 .with ("GET" , "/oidc/.well-known/oauth-authorization-server" , "" , 429 )
122124 .with (
123125 "GET" ,
@@ -443,7 +445,9 @@ public void testGetHostMetadataWorkspaceStaticOidcEndpoint() throws IOException
443445 + DUMMY_WORKSPACE_ID
444446 + "\" }" ;
445447 try (FixtureServer server =
446- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
448+ new FixtureServer ()
449+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )
450+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
447451 DatabricksConfig config = new DatabricksConfig ().setHost (server .getUrl ());
448452 config .resolve (emptyEnv ());
449453 HostMetadata meta = config .getHostMetadata ();
@@ -458,7 +462,9 @@ public void testGetHostMetadataAccountRawOidcTemplate() throws IOException {
458462 String response =
459463 "{\" oidc_endpoint\" :\" https://acc.databricks.com/oidc/accounts/{account_id}\" }" ;
460464 try (FixtureServer server =
461- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
465+ new FixtureServer ()
466+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )
467+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
462468 DatabricksConfig config = new DatabricksConfig ().setHost (server .getUrl ());
463469 config .resolve (emptyEnv ());
464470 HostMetadata meta = config .getHostMetadata ();
@@ -471,7 +477,9 @@ public void testGetHostMetadataAccountRawOidcTemplate() throws IOException {
471477 @ Test
472478 public void testGetHostMetadataRaisesOnHttpError () throws IOException {
473479 try (FixtureServer server =
474- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , "{}" , 404 )) {
480+ new FixtureServer ()
481+ .with ("GET" , "/.well-known/databricks-config" , "{}" , 404 )
482+ .with ("GET" , "/.well-known/databricks-config" , "{}" , 404 )) {
475483 DatabricksConfig config = new DatabricksConfig ().setHost (server .getUrl ());
476484 config .resolve (emptyEnv ());
477485 DatabricksException ex =
@@ -493,7 +501,9 @@ public void testResolveHostMetadataWorkspacePopulatesAllFields() throws IOExcept
493501 + DUMMY_WORKSPACE_ID
494502 + "\" }" ;
495503 try (FixtureServer server =
496- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
504+ new FixtureServer ()
505+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )
506+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
497507 DatabricksConfig config = new DatabricksConfig ().setHost (server .getUrl ());
498508 config .resolve (emptyEnv ());
499509 config .resolveHostMetadata ();
@@ -508,7 +518,9 @@ public void testResolveHostMetadataAccountSubstitutesAccountId() throws IOExcept
508518 String response =
509519 "{\" oidc_endpoint\" :\" https://acc.databricks.com/oidc/accounts/{account_id}\" }" ;
510520 try (FixtureServer server =
511- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
521+ new FixtureServer ()
522+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )
523+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
512524 DatabricksConfig config =
513525 new DatabricksConfig ().setHost (server .getUrl ()).setAccountId (DUMMY_ACCOUNT_ID );
514526 config .resolve (emptyEnv ());
@@ -527,7 +539,9 @@ public void testResolveHostMetadataDoesNotOverwriteExistingFields() throws IOExc
527539 + "\" account_id\" :\" other-account\" ,"
528540 + "\" workspace_id\" :\" other-ws\" }" ;
529541 try (FixtureServer server =
530- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
542+ new FixtureServer ()
543+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )
544+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
531545 DatabricksConfig config =
532546 new DatabricksConfig ()
533547 .setHost (server .getUrl ())
@@ -545,7 +559,9 @@ public void testResolveHostMetadataRaisesWhenAccountIdUnresolvable() throws IOEx
545559 String response =
546560 "{\" oidc_endpoint\" :\" https://acc.databricks.com/oidc/accounts/{account_id}\" }" ;
547561 try (FixtureServer server =
548- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
562+ new FixtureServer ()
563+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )
564+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
549565 DatabricksConfig config = new DatabricksConfig ().setHost (server .getUrl ());
550566 config .resolve (emptyEnv ());
551567 DatabricksException ex =
@@ -558,7 +574,9 @@ public void testResolveHostMetadataRaisesWhenAccountIdUnresolvable() throws IOEx
558574 public void testResolveHostMetadataRaisesWhenOidcEndpointMissing () throws IOException {
559575 String response = "{\" account_id\" :\" " + DUMMY_ACCOUNT_ID + "\" }" ;
560576 try (FixtureServer server =
561- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
577+ new FixtureServer ()
578+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )
579+ .with ("GET" , "/.well-known/databricks-config" , response , 200 )) {
562580 DatabricksConfig config = new DatabricksConfig ().setHost (server .getUrl ());
563581 config .resolve (emptyEnv ());
564582 DatabricksException ex =
@@ -570,7 +588,9 @@ public void testResolveHostMetadataRaisesWhenOidcEndpointMissing() throws IOExce
570588 @ Test
571589 public void testResolveHostMetadataRaisesOnHttpError () throws IOException {
572590 try (FixtureServer server =
573- new FixtureServer ().with ("GET" , "/.well-known/databricks-config" , "{}" , 500 )) {
591+ new FixtureServer ()
592+ .with ("GET" , "/.well-known/databricks-config" , "{}" , 500 )
593+ .with ("GET" , "/.well-known/databricks-config" , "{}" , 500 )) {
574594 DatabricksConfig config = new DatabricksConfig ().setHost (server .getUrl ());
575595 config .resolve (emptyEnv ());
576596 DatabricksException ex =
0 commit comments