Ejemplo n.º 1
0
  public void testIncludesBothOriginalAndMappedGenres() throws Exception {

    Set<String> genres = Sets.newHashSet("http://ref.atlasapi.org/genres/youtube/comedy");
    Set<String> mappedGenres = genreMap.map(genres);
    assertThat(mappedGenres.size(), is(2));
    assertThat(mappedGenres, hasItem("http://ref.atlasapi.org/genres/youtube/comedy"));
  }
Ejemplo n.º 2
0
  public void testIsNotCaseSensitive() throws Exception {

    Set<String> genres = Sets.newHashSet("http://ref.atlasapi.org/genres/youtube/Comedy");
    Set<String> mappedGenres = genreMap.map(genres);
    assertThat(mappedGenres.size(), is(2));
    assertThat(mappedGenres, hasItem("http://ref.atlasapi.org/genres/youtube/Comedy"));
    assertThat(mappedGenres, hasItem("http://ref.atlasapi.org/genres/atlas/comedy"));
  }
Ejemplo n.º 3
0
 private void setGenres(ProgData progData, Content content) {
   Set<String> extractedGenres =
       genreMap.map(
           ImmutableSet.copyOf(Iterables.transform(progData.getCategory(), TO_GENRE_URIS)));
   extractedGenres.remove("http://pressassociation.com/genres/BE00");
   if (!extractedGenres.isEmpty()) {
     content.setGenres(extractedGenres);
   }
 }
Ejemplo n.º 4
0
  public void testReturnsGenresAsInputForUnknownGenres() throws Exception {

    Set<String> genres = Sets.newHashSet("http://example.com/genres/unknown");
    assertThat(genreMap.map(genres), is(genres));
  }
Ejemplo n.º 5
0
  public void testMapsGenresFromYoutubeGenresToAtlasGenres() throws Exception {

    Set<String> genres = Sets.newHashSet("http://ref.atlasapi.org/genres/youtube/comedy");
    assertThat(genreMap.map(genres), hasItem("http://ref.atlasapi.org/genres/atlas/comedy"));
  }