@Test
public void testGetOAuth2UserAppEngineProdClientIdNotAllowed() throws Exception {

  when(config.getScopeExpression()).thenReturn(AuthScopeExpressions.interpret(SCOPES));
  when(oauthService.getAuthorizedScopes(SCOPES)).thenReturn(SCOPES);
  when(oauthService.getClientId(SCOPES)).thenThrow(new OAuthRequestException("any"))
      .thenReturn(null).thenReturn(CLIENT_ID);
  when(config.getClientIds()).thenReturn(ImmutableList.of("clientId2"));
  for (int i = 0; i < 3; i++) {
    assertNull(authenticator.getOAuth2User(request, config));
  }
}