File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
oauth2_http/javatests/com/google/auth/oauth2 Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -888,6 +888,21 @@ public void getUniverseDomain_defaultUniverse() throws IOException {
888888 assertEquals (GOOGLE_DEFAULT_UNIVERSE , credentials .getUniverseDomain ());
889889 }
890890
891+ @ Test
892+ public void getUniverseDomain_customUniverse () throws IOException {
893+ PrivateKey privateKey = OAuth2Utils .privateKeyFromPkcs8 (SA_PRIVATE_KEY_PKCS8 );
894+ ServiceAccountJwtAccessCredentials credentials =
895+ ServiceAccountJwtAccessCredentials .newBuilder ()
896+ .setClientId (SA_CLIENT_ID )
897+ .setClientEmail (SA_CLIENT_EMAIL )
898+ .setPrivateKey (privateKey )
899+ .setPrivateKeyId (SA_PRIVATE_KEY_ID )
900+ .setDefaultAudience (URI .create ("default-audience" ))
901+ .setUniverseDomain ("example.com" )
902+ .build ();
903+ assertEquals ("example.com" , credentials .getUniverseDomain ());
904+ }
905+
891906 private void verifyJwtAccess (
892907 Map <String , List <String >> metadata ,
893908 String expectedEmail ,
You can’t perform that action at this time.
0 commit comments