@Test
public void testAuthenticate_success() {

  request = createRequest("myhost.com", 456, "", "", "");
  request.setRemoteAddr("8.8.8.8");
  payload.setEmail(EndpointsPeerAuthenticator.SIGNER);
  payload.setAudience("http://myhost.com:456/api");
  request.addHeader(EndpointsPeerAuthenticator.HEADER_PEER_AUTHORIZATION, FAKE_TOKEN);
  when(jwtAuthenticator.verifyToken(FAKE_TOKEN)).thenReturn(token);
  when(token.getPayload()).thenReturn(payload);
  assertTrue(authenticator.authenticate(request));
}