From 43aede87a6edf735c7197bbf60f7697ad43717b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Fern=C3=A1ndez?= Date: Thu, 23 Jun 2022 13:02:27 +0200 Subject: [PATCH] fix: formatting --- .../oauth2/ImpersonatedCredentialsTest.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/oauth2_http/javatests/com/google/auth/oauth2/ImpersonatedCredentialsTest.java b/oauth2_http/javatests/com/google/auth/oauth2/ImpersonatedCredentialsTest.java index 6a3dcf07b..c829208ce 100644 --- a/oauth2_http/javatests/com/google/auth/oauth2/ImpersonatedCredentialsTest.java +++ b/oauth2_http/javatests/com/google/auth/oauth2/ImpersonatedCredentialsTest.java @@ -71,7 +71,6 @@ import java.util.Map; import java.util.Set; import java.util.TimeZone; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -585,7 +584,8 @@ void refreshAccessToken_GMT_dateParsedCorrectly() throws IOException, IllegalSta mockTransportFactory); assertEquals(ACCESS_TOKEN, targetCredentials.refreshAccessToken().getTokenValue()); - assertEquals(c.getTime().toInstant().truncatedTo(ChronoUnit.SECONDS).toEpochMilli(), + assertEquals( + c.getTime().toInstant().truncatedTo(ChronoUnit.SECONDS).toEpochMilli(), targetCredentials.refreshAccessToken().getExpirationTimeMillis()); assertEquals(DEFAULT_IMPERSONATION_URL, mockTransportFactory.transport.getRequest().getUrl()); } @@ -598,7 +598,8 @@ void refreshAccessToken_PDT_dateParsedCorrectly() throws IOException, IllegalSta mockTransportFactory.transport.setTargetPrincipal(IMPERSONATED_CLIENT_EMAIL); mockTransportFactory.transport.setAccessToken(ACCESS_TOKEN); - mockTransportFactory.transport.setExpireTime(getFormattedTime(c.getTime(), TimeZone.getTimeZone("PDT"))); + mockTransportFactory.transport.setExpireTime( + getFormattedTime(c.getTime(), TimeZone.getTimeZone("PDT"))); ImpersonatedCredentials targetCredentials = ImpersonatedCredentials.create( sourceCredentials, @@ -609,7 +610,8 @@ void refreshAccessToken_PDT_dateParsedCorrectly() throws IOException, IllegalSta mockTransportFactory); assertEquals(ACCESS_TOKEN, targetCredentials.refreshAccessToken().getTokenValue()); - assertEquals(c.getTime().toInstant().truncatedTo(ChronoUnit.SECONDS).toEpochMilli(), + assertEquals( + c.getTime().toInstant().truncatedTo(ChronoUnit.SECONDS).toEpochMilli(), targetCredentials.refreshAccessToken().getExpirationTimeMillis()); assertEquals(DEFAULT_IMPERSONATION_URL, mockTransportFactory.transport.getRequest().getUrl()); } @@ -982,18 +984,19 @@ public static String getDefaultExpireTime() { } /** - Given a {@link Date}, it will return a string of the date - formatted like yyyy-MM-dd'T'HH:mm:ss'Z' + * Given a {@link Date}, it will return a string of the date formatted like + * yyyy-MM-dd'T'HH:mm:ss'Z' */ private static String getFormattedTime(final Date date) { - //Set timezone to GMT since that's the TZ used in the response from the service impersonation token exchange + // Set timezone to GMT since that's the TZ used in the response from the service impersonation + // token exchange return getFormattedTime(date, TimeZone.getTimeZone("GMT")); } /** - Given a {@link Date} and a desired {@link TimeZone}, it will return a string of the date - formatted like yyyy-MM-dd'T'HH:mm:ssX' where X represents a timezone - code following RFC3339 standard + * Given a {@link Date} and a desired {@link TimeZone}, it will return a string of the date + * formatted like yyyy-MM-dd'T'HH:mm:ssX' where X represents a timezone code following + * RFC3339 standard */ private static String getFormattedTime(final Date date, final TimeZone timeZone) { final DateFormat formatter = new SimpleDateFormat(RFC3339);