@Test
public void testHttpPostGzipHeader() throws TransportException, IOException {

  byte[] respPayload = "{}".getBytes(StandardCharsets.UTF_8);
  byte[] payload = "foo".getBytes();
  String url = "https://localhost:443/foo";
  HttpClient client = getMockClientWithResponse(respPayload, ContentType.APPLICATION_JSON,
      HttpStatus.SC_OK, false);
  HttpTransport transport = spy(new HttpTransport(client, url, true, 1, 1));
  transport.sendBatch(payload);
  ArgumentCaptor<HttpPost> captor = ArgumentCaptor.forClass(HttpPost.class);
  verify(client, times(1)).execute(captor.capture());
  assertEquals("gzip", captor.getValue().getFirstHeader("Accept-Encoding").getValue());
}