@Test
public void testPropagatesHttpHeadersUpstream() throws Exception {

  CacheDataSource cacheDataSource =
      createCacheDataSource(/* setReadException= */ false, /* unknownLength= */ false);
  DataSpec dataSpec = buildDataSpec(/* position= */ 2, /* length= */ 5);
  cacheDataSource.open(dataSpec);
  DataSpec[] upstreamDataSpecs = upstreamDataSource.getAndClearOpenedDataSpecs();
  assertThat(upstreamDataSpecs).hasLength(1);
  assertThat(upstreamDataSpecs[0].httpRequestHeaders).isEqualTo(this.httpRequestHeaders);
}