@Test public void shouldNotResolveTokenRequest_invalidScope_withUser() { final String scope = "read"; TokenRequest tokenRequest = new TokenRequest(); tokenRequest.setScopes(Collections.singleton(scope)); Client client = new Client(); client.setScopes(Collections.singletonList("write")); User user = new User(); Role role = new Role(); role.setOauthScopes(Collections.singletonList("user")); user.setRolesPermissions(Collections.singleton(role)); TestObserver<TokenRequest> testObserver = tokenRequestResolver.resolve(tokenRequest, client, user).test(); testObserver.assertNotComplete(); testObserver.assertError(InvalidScopeException.class); }
public Single<TokenRequest> resolve(TokenRequest tokenRequest, Client client, User endUser) { return resolveAuthorizedScopes(tokenRequest, client, endUser); }
TokenRequestResolver extends AbstractRequestResolver<TokenRequest> { public Single<TokenRequest> resolve(TokenRequest tokenRequest, Client client, User endUser) { return resolveAuthorizedScopes(tokenRequest, client, endUser); } }
TokenRequestResolver extends AbstractRequestResolver<TokenRequest> { public Single<TokenRequest> resolve(TokenRequest tokenRequest, Client client, User endUser) { return resolveAuthorizedScopes(tokenRequest, client, endUser); }  }
TokenRequestResolver extends AbstractRequestResolver<TokenRequest> { public Single<TokenRequest> resolve(TokenRequest tokenRequest, Client client, User endUser) { return resolveAuthorizedScopes(tokenRequest, client, endUser); }  Single<TokenRequest> resolve(TokenRequest tokenRequest, Client client, User endUser); }
TokenRequestResolver extends AbstractRequestResolver<TokenRequest> { public Single<TokenRequest> resolve(TokenRequest tokenRequest, Client client, User endUser) { return resolveAuthorizedScopes(tokenRequest, client, endUser); }  Single<TokenRequest> resolve(TokenRequest tokenRequest, Client client, User endUser);  }