コード例 #1
0
  @Test
  @Ignore
  // Ingored until we have real data which allows us to
  // correctly implement availability criteria
  public void testOnlyExtractsTrailerWhenMatchesCriteria() {
    BtVodEntry btVodEntry = episodeRow(FULL_EPISODE_TITLE, PRODUCT_GUID);
    ParentRef parentRef = new ParentRef(BRAND_URI);

    when(imageExtractor.imagesFor(Matchers.<BtVodEntry>any())).thenReturn(ImmutableSet.<Image>of());
    when(seriesProvider.seriesFor(btVodEntry)).thenReturn(Optional.of(mock(Series.class)));
    when(btVodBrandProvider.brandRefFor(btVodEntry)).thenReturn(Optional.of(parentRef));

    btVodEntry.setProductTags(ImmutableList.<BtVodPlproduct$productTag>of());

    Item writtenItem = Iterables.getOnlyElement(itemExtractor.getProcessedItems().values());

    assertTrue(writtenItem.getClips().isEmpty());
  }
コード例 #2
0
  private BtVodEntry episodeRow(String title, String guid) {
    BtVodEntry entry = new BtVodEntry();
    entry.setGuid(guid);
    entry.setId(PRODUCT_ID);
    entry.setTitle(title);
    entry.setProductOfferStartDate(1364774400000L); // "Apr  1 2013 12:00AM"
    entry.setProductOfferEndDate(1398816000000L); // "Apr 30 2014 12:00AM"
    entry.setDescription(SYNOPSIS);
    entry.setProductType("episode");
    entry.setProductPricingPlan(new BtVodProductPricingPlan());
    entry.setProductTrailerMediaId(TRAILER_URI);
    BtVodProductScope productScope = new BtVodProductScope();
    BtVodProductMetadata productMetadata = new BtVodProductMetadata();
    productMetadata.setEpisodeNumber("1");
    productScope.setProductMetadata(productMetadata);
    entry.setProductScopes(ImmutableList.of(productScope));
    entry.setProductRatings(ImmutableList.<BtVodProductRating>of());
    BtVodPlproduct$productTag tag = new BtVodPlproduct$productTag();
    tag.setPlproduct$scheme("subscription");
    tag.setPlproduct$title(SUBSCRIPTION_CODE);

    BtVodPlproduct$productTag trailerCdnAvailabilityTag = new BtVodPlproduct$productTag();
    trailerCdnAvailabilityTag.setPlproduct$scheme("trailerServiceType");
    trailerCdnAvailabilityTag.setPlproduct$title("OTG");

    BtVodPlproduct$productTag itemCdnAvailabilityTag = new BtVodPlproduct$productTag();
    itemCdnAvailabilityTag.setPlproduct$scheme("serviceType");
    itemCdnAvailabilityTag.setPlproduct$title("OTG");

    BtVodPlproduct$productTag itemMasterAgreementAvailabilityTag = new BtVodPlproduct$productTag();
    itemMasterAgreementAvailabilityTag.setPlproduct$scheme("masterAgreementOtgTvodPlay");
    itemMasterAgreementAvailabilityTag.setPlproduct$title("TRUE");

    entry.setProductTags(
        ImmutableList.of(
            tag,
            trailerCdnAvailabilityTag,
            itemCdnAvailabilityTag,
            itemMasterAgreementAvailabilityTag));

    return entry;
  }
コード例 #3
0
  private BtVodEntry filmRow(String title) {
    BtVodEntry entry = new BtVodEntry();
    entry.setGuid(PRODUCT_GUID);
    entry.setId(PRODUCT_ID);
    entry.setTitle(title);
    entry.setProductOfferStartDate(
        new DateTime(2013, DateTimeConstants.APRIL, 1, 0, 0, 0, 0).getMillis());
    entry.setProductOfferEndDate(
        new DateTime(2014, DateTimeConstants.APRIL, 30, 0, 0, 0).getMillis());
    entry.setDescription(SYNOPSIS);
    entry.setProductType("film");
    entry.setProductPricingPlan(new BtVodProductPricingPlan());
    entry.setProductTrailerMediaId(TRAILER_URI);
    BtVodProductScope productScope = new BtVodProductScope();
    BtVodProductMetadata productMetadata = new BtVodProductMetadata();
    productMetadata.setReleaseYear("2015");
    productScope.setProductMetadata(productMetadata);
    entry.setProductScopes(ImmutableList.of(productScope));
    entry.setProductRatings(ImmutableList.<BtVodProductRating>of());
    BtVodPlproduct$productTag tag = new BtVodPlproduct$productTag();
    tag.setPlproduct$scheme("subscription");
    tag.setPlproduct$title(SUBSCRIPTION_CODE);

    BtVodPlproduct$productTag itemCdnAvailabilityTag = new BtVodPlproduct$productTag();
    itemCdnAvailabilityTag.setPlproduct$scheme("serviceType");
    itemCdnAvailabilityTag.setPlproduct$title("OTG");

    BtVodPlproduct$productTag itemMasterAgreementAvailabilityTag = new BtVodPlproduct$productTag();
    itemMasterAgreementAvailabilityTag.setPlproduct$scheme("masterAgreementOtgTvodPlay");
    itemMasterAgreementAvailabilityTag.setPlproduct$title("TRUE");

    entry.setProductTags(
        ImmutableList.of(tag, itemCdnAvailabilityTag, itemMasterAgreementAvailabilityTag));

    return entry;
  }