This commit is contained in:
Rob Winch 2021-07-09 11:01:00 -05:00
parent e251abb1ae
commit 98bd772b67
1 changed files with 10 additions and 5 deletions

View File

@ -64,7 +64,8 @@ public class DefaultMapOAuth2AccessTokenResponseConverterTests {
Assertions.assertEquals(2, scopes.size());
Assertions.assertTrue(scopes.contains("read"));
Assertions.assertTrue(scopes.contains("write"));
Assertions.assertEquals(3600, Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
Assertions.assertEquals(3600,
Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
OAuth2RefreshToken refreshToken = converted.getRefreshToken();
Assertions.assertNotNull(refreshToken);
Assertions.assertEquals("refresh-token-1234", refreshToken.getTokenValue());
@ -88,7 +89,8 @@ public class DefaultMapOAuth2AccessTokenResponseConverterTests {
Set<String> scopes = accessToken.getScopes();
Assertions.assertNotNull(scopes);
Assertions.assertEquals(0, scopes.size());
Assertions.assertEquals(1, Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
Assertions.assertEquals(1,
Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
OAuth2RefreshToken refreshToken = converted.getRefreshToken();
Assertions.assertNull(refreshToken);
Map<String, Object> additionalParameters = converted.getAdditionalParameters();
@ -110,7 +112,8 @@ public class DefaultMapOAuth2AccessTokenResponseConverterTests {
Set<String> scopes = accessToken.getScopes();
Assertions.assertNotNull(scopes);
Assertions.assertEquals(0, scopes.size());
Assertions.assertEquals(1, Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
Assertions.assertEquals(1,
Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
OAuth2RefreshToken refreshToken = converted.getRefreshToken();
Assertions.assertNull(refreshToken);
Map<String, Object> additionalParameters = converted.getAdditionalParameters();
@ -130,7 +133,8 @@ public class DefaultMapOAuth2AccessTokenResponseConverterTests {
Assertions.assertNotNull(accessToken);
Assertions.assertEquals("access-token-1234", accessToken.getTokenValue());
Assertions.assertEquals(OAuth2AccessToken.TokenType.BEARER, accessToken.getTokenType());
Assertions.assertEquals(3600, Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
Assertions.assertEquals(3600,
Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
}
// gh-9685
@ -157,7 +161,8 @@ public class DefaultMapOAuth2AccessTokenResponseConverterTests {
Assertions.assertEquals(2, scopes.size());
Assertions.assertTrue(scopes.contains("read"));
Assertions.assertTrue(scopes.contains("write"));
Assertions.assertEquals(3600, Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
Assertions.assertEquals(3600,
Duration.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()).getSeconds());
OAuth2RefreshToken refreshToken = converted.getRefreshToken();
Assertions.assertNotNull(refreshToken);
Assertions.assertEquals("refresh-token-1234", refreshToken.getTokenValue());