From 7fd94c0c2d2b900d1562d756eb3817f5349c4824 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Wed, 31 Jul 2019 12:21:06 -0400 Subject: [PATCH] fix: cleanup unused code and deprecation warnings (#315) --- .../google/auth/oauth2/ServiceAccountJwtAccessCredentials.java | 2 +- .../google/auth/oauth2/MockIAMCredentialsServiceTransport.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java b/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java index 91b5bd77e..16b61c6d4 100644 --- a/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java +++ b/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java @@ -330,7 +330,7 @@ private String getJwtAccess(URI uri) throws IOException { "generateJwtAccess threw an unexpected checked exception", e.getCause()); } catch (UncheckedExecutionException e) { - Throwables.propagateIfPossible(e); + Throwables.throwIfUnchecked(e); // Should never happen throw new IllegalStateException( "generateJwtAccess threw an unchecked exception that couldn't be rethrown", e); diff --git a/oauth2_http/javatests/com/google/auth/oauth2/MockIAMCredentialsServiceTransport.java b/oauth2_http/javatests/com/google/auth/oauth2/MockIAMCredentialsServiceTransport.java index bedae3ee6..6a7b41405 100644 --- a/oauth2_http/javatests/com/google/auth/oauth2/MockIAMCredentialsServiceTransport.java +++ b/oauth2_http/javatests/com/google/auth/oauth2/MockIAMCredentialsServiceTransport.java @@ -48,8 +48,6 @@ public class MockIAMCredentialsServiceTransport extends MockHttpTransport { private static final String IAM_ACCESS_TOKEN_ENDPOINT = "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/%s:generateAccessToken"; - private static final String IAM_ID_TOKEN_ENDPOINT = - "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/%s:generateIdToken"; private static final String IAM_SIGN_ENDPOINT = "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/%s:signBlob"; private Integer tokenResponseErrorCode; @@ -147,7 +145,6 @@ public LowLevelHttpResponse execute() throws IOException { GenericJson refreshContents = new GenericJson(); refreshContents.setFactory(OAuth2Utils.JSON_FACTORY); refreshContents.put("signedBlob", base64.encode(signedBlob)); - String refreshText = refreshContents.toPrettyString(); return new MockLowLevelHttpResponse() .setStatusCode(responseCode) .setContent(TestUtils.errorJson(errorMessage));