File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
oauth2_http/javatests/com/google/auth/oauth2 Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -988,13 +988,14 @@ public void idTokenWithAudience_oauthEndpoint_non2XXError() throws IOException {
988988 .setUniverseDomain (universeDomain )
989989 .build ();
990990
991- String targetAudience = "differentAudience " ;
991+ String targetAudience = "audience " ;
992992 IdTokenCredentials tokenCredential =
993993 IdTokenCredentials .newBuilder ()
994994 .setIdTokenProvider (credentials )
995995 .setTargetAudience (targetAudience )
996996 .build ();
997997
998+ // Ensure that a non 2xx status code returns an exception and doesn't continue execution
998999 assertThrows (IOException .class , tokenCredential ::refresh );
9991000 }
10001001
@@ -1015,13 +1016,15 @@ public void idTokenWithAudience_iamEndpoint_non2XXError() throws IOException {
10151016 .setUniverseDomain (universeDomain )
10161017 .build ();
10171018
1018- String targetAudience = "differentAudience " ;
1019+ String targetAudience = "audience " ;
10191020 IdTokenCredentials tokenCredential =
10201021 IdTokenCredentials .newBuilder ()
10211022 .setIdTokenProvider (credentials )
10221023 .setTargetAudience (targetAudience )
10231024 .build ();
10241025
1026+ // Ensure that a non 2xx status code returns an exception and doesn't continue execution
1027+ // Non 2xx status codes will be returned as HttpResponseException
10251028 assertThrows (IOException .class , tokenCredential ::refresh );
10261029 }
10271030
You can’t perform that action at this time.
0 commit comments