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")); }
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")); }
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); } }
public void testReturnsGenresAsInputForUnknownGenres() throws Exception { Set<String> genres = Sets.newHashSet("http://example.com/genres/unknown"); assertThat(genreMap.map(genres), is(genres)); }
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")); }