@Test
public void parseMediaPresentationDescription_segmentTemplate() throws IOException {

  DashManifestParser parser = new DashManifestParser();
  DashManifest mpd =
      parser.parse(
          Uri.parse("https://example.com/test.mpd"),
          TestUtil.getInputStream(
              ApplicationProvider.getApplicationContext(), SAMPLE_MPD_SEGMENT_TEMPLATE));
  assertThat(mpd.getPeriodCount()).isEqualTo(1);
  Period period = mpd.getPeriod(0);
  assertThat(period).isNotNull();
  assertThat(period.adaptationSets).hasSize(2);
  for (AdaptationSet adaptationSet : period.adaptationSets) {
    assertThat(adaptationSet).isNotNull();
    for (Representation representation : adaptationSet.representations) {
      if (representation instanceof Representation.MultiSegmentRepresentation) {
        Representation.MultiSegmentRepresentation multiSegmentRepresentation =
            (Representation.MultiSegmentRepresentation) representation;
        long firstSegmentIndex = multiSegmentRepresentation.getFirstSegmentNum();
        RangedUri uri = multiSegmentRepresentation.getSegmentUrl(firstSegmentIndex);
        assertThat(
                uri.resolveUriString(representation.baseUrl)
                    .contains("redirector.googlevideo.com"))
            .isTrue();
      }
    }
  }
}