@Test
public void testAuthenticate() throws ServiceUnavailableException {

  when(config.getScopeExpression()).thenReturn(AuthScopeExpressions.interpret("scope1"));
  when(config.getClientIds()).thenReturn(ImmutableList.of(CLIENT_ID));
  User user = authenticator.authenticate(request);
  assertEquals(EMAIL, user.getEmail());
  assertEquals(USER_ID, user.getId());
  final TokenInfo tokenInfo = attr.get(Attribute.TOKEN_INFO);
  assertNotNull(tokenInfo);
  assertEquals(EMAIL, tokenInfo.email);
  assertEquals(USER_ID, tokenInfo.userId);
}