96 Set<String> authScopes =
scopes(
"foo",
"bar",
"baz");
103 Map<String, Object> expected =
new ImmutableMap.Builder<String, Object>()
106 .put(
"expires_at",
dateFormat.valueToString(
new Date(123 * 1000L)))
107 .put(
"permissions",
new ImmutableSet.Builder<>()
108 .add(
new ImmutableMap.Builder<String, Object>()
109 .put(
"resource_set_id",
"1")
110 .put(
"scopes",
new ImmutableSet.Builder<>()
117 .put(
"active", Boolean.TRUE)
118 .put(
"user_id",
"name")
119 .put(
"client_id",
"clientId")
120 .put(
"token_type",
"Bearer")
122 assertThat(result, is(equalTo(expected)));
OAuth2AccessTokenEntity accessToken(Date exp, Set< String > scopes, Set< Permission > permissions, String tokenType, OAuth2Authentication authentication)
Definition: TestDefaultIntrospectionResultAssembler.java:314
IntrospectionResultAssembler assembler
Definition: TestDefaultIntrospectionResultAssembler.java:53
static DateFormatter dateFormat
Definition: TestDefaultIntrospectionResultAssembler.java:55
Set< Permission > permissions(Permission... permissions)
Definition: TestDefaultIntrospectionResultAssembler.java:352
OAuth2Request oauth2Request(String clientId)
Definition: TestDefaultIntrospectionResultAssembler.java:340
Set< String > scopes(String... scopes)
Definition: TestDefaultIntrospectionResultAssembler.java:348
UserInfo userInfo(String sub)
Definition: TestDefaultIntrospectionResultAssembler.java:308
Permission permission(Long resourceSetId, String... scopes)
Definition: TestDefaultIntrospectionResultAssembler.java:356
Map< String, Object > assembleFrom(OAuth2AccessTokenEntity accessToken, UserInfo userInfo, Set< String > authScopes)
OAuth2Authentication oauth2AuthenticationWithUser(OAuth2Request request, String username)
Definition: TestDefaultIntrospectionResultAssembler.java:331