@Test
public void testAuthenticateOAuth2() throws ServiceUnavailableException {

  authenticator = new GoogleAppEngineAuthenticator(oauthService, userService) {
    @Override
    com.google.appengine.api.users.User getOAuth2User(HttpServletRequest request,
        ApiMethodConfig config) {
      return APP_ENGINE_USER;
    }
  };
  assertEquals(USER, authenticator.authenticate(request));
  assertEquals(APP_ENGINE_USER, attr.get(Attribute.AUTHENTICATED_APPENGINE_USER));
}