@Test
public void testAuthenticate() throws Exception {

  when(verifier.verify(TOKEN)).thenReturn(token);
  when(config.getClientIds()).thenReturn(ImmutableList.of(CLIENT_ID));
  when(config.getAudiences()).thenReturn(ImmutableList.of(AUDIENCE));
  User user = authenticator.authenticate(request);
  assertEquals(EMAIL, user.getEmail());
  assertEquals(USER_ID, user.getId());
  GoogleIdToken idToken = attr.get(Attribute.ID_TOKEN);
  assertNotNull(idToken);
  assertEquals(EMAIL, idToken.getPayload().getEmail());
  assertEquals(USER_ID, idToken.getPayload().getSubject());
}