@Test
public void testGetAuthToken_fromHeaders() {

  for (String scheme : GoogleAuth.ALLOWED_AUTH_SCHEMES) {
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.addHeader(GoogleAuth.AUTHORIZATION_HEADER, scheme + " some-value");
    assertEquals("some-value", GoogleAuth.getAuthToken(request));
  }
  MockHttpServletRequest request = new MockHttpServletRequest();
  request.addHeader(GoogleAuth.AUTHORIZATION_HEADER, "noSuchAuthScheme some-value");
  assertNull(GoogleAuth.getAuthToken(request));
}