@Test
public void testRequestOpenGzippedCompressedReturnsDataSpecLength()
    throws HttpDataSourceException {

  testDataSpec = new DataSpec(Uri.parse(TEST_URL), 0, 5000, null);
  testResponseHeader.put("Content-Encoding", "gzip");
  testResponseHeader.put("Content-Length", Long.toString(50L));
  mockResponseStartSuccess();
  assertThat(dataSourceUnderTest.open(testDataSpec)).isEqualTo(5000 /* contentLength */);
  verify(mockTransferListener)
      .onTransferStart(dataSourceUnderTest, testDataSpec, /* isNetwork= */ true);
}