Partial Find

master
Stuart Boston 11 years ago
parent 5b4acf1f8c
commit d3c508aabf

@ -61,8 +61,8 @@ import com.omertron.themoviedbapi.model.person.PersonCredit;
import com.omertron.themoviedbapi.model.ReleaseInfo;
import com.omertron.themoviedbapi.model.Reviews;
import com.omertron.themoviedbapi.model2.StatusCode;
import com.omertron.themoviedbapi.model.TBD_ExternalSource;
import com.omertron.themoviedbapi.model.TBD_FindResults;
import com.omertron.themoviedbapi.enumeration.ExternalSource;
import com.omertron.themoviedbapi.model2.FindResults;
import com.omertron.themoviedbapi.model.TBD_Network;
import com.omertron.themoviedbapi.model2.person.CreditInfo;
import com.omertron.themoviedbapi.model2.authentication.TokenAuthorisation;
@ -709,7 +709,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public TBD_FindResults find(String id, TBD_ExternalSource externalSource, String language) throws MovieDbException {
public FindResults find(String id, ExternalSource externalSource, String language) throws MovieDbException {
return tmdbFind.find(id, externalSource, language);
}
//</editor-fold>

@ -17,29 +17,22 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
package com.omertron.themoviedbapi.enumeration;
/**
* @author stuart.boston
*
* @author Stuart
*/
@JsonRootName("???")
public class TBD_FindResults extends AbstractJsonMapping {
public enum ExternalSource {
private static final long serialVersionUID = 1L;
FREEBASE_ID,
FREEBASE_MID,
IMDB_ID,
TVDB_ID,
TVRAGE_ID;
// Properties
@JsonProperty("id")
private int id;
public int getId() {
return id;
public String getPropertyString() {
return this.name().toLowerCase();
}
public void setId(int id) {
this.id = id;
}
}

@ -20,9 +20,15 @@
package com.omertron.themoviedbapi.methods;
import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.model.TBD_ExternalSource;
import com.omertron.themoviedbapi.model.TBD_FindResults;
import com.omertron.themoviedbapi.enumeration.ExternalSource;
import com.omertron.themoviedbapi.model2.FindResults;
import com.omertron.themoviedbapi.tools.ApiUrl;
import com.omertron.themoviedbapi.tools.HttpTools;
import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.tools.Param;
import com.omertron.themoviedbapi.tools.TmdbParameters;
import java.io.IOException;
import java.net.URL;
import org.yamj.api.common.exception.ApiExceptionType;
/**
@ -43,18 +49,16 @@ public class TmdbFind extends AbstractMethod {
}
/**
* You con use this method to find movies, tv series or persons using
* external ids.
* You con use this method to find movies, tv series or persons using external ids.
*
* Supported query ids are
* <ul>
* <li>Movies: imdb_id</li>
* <li>People: imdb_id, freebase_mid, freebase_id, tvrage_id</li>
* <li>TV Series: imdb_id, freebase_mid, freebase_id, tvdb_id,
* tvrage_id</li>
* <li>TV Series: imdb_id, freebase_mid, freebase_id, tvdb_id, tvrage_id</li>
* <li>TV Seasons: freebase_mid, freebase_id, tvdb_id, tvrage_id</li>
* <li>TV Episodes: imdb_id, freebase_mid, freebase_id, tvdb_id,
* tvrage_idimdb_id, freebase_mid, freebase_id, tvrage_id, tvdb_id.
* <li>TV Episodes: imdb_id, freebase_mid, freebase_id, tvdb_id, tvrage_idimdb_id, freebase_mid, freebase_id, tvrage_id,
* tvdb_id.
* </ul>
*
* For details see http://docs.themoviedb.apiary.io/#find
@ -65,7 +69,20 @@ public class TmdbFind extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public TBD_FindResults find(String id, TBD_ExternalSource externalSource, String language) throws MovieDbException {
throw new MovieDbException(ApiExceptionType.UNKNOWN_CAUSE, "not implemented yet");
public FindResults find(String id, ExternalSource externalSource, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, id);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.EXTERNAL_SOURCE, externalSource.getPropertyString());
URL url = new ApiUrl(apiKey, MethodBase.FIND).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, FindResults.class);
} catch (IOException ex) {
LOG.info("{}",ex.getMessage(),ex);
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get find results", url, ex);
}
}
}

@ -1,45 +0,0 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
/**
* @author stuart.boston
*/
@JsonRootName("???")
public class TBD_ExternalSource extends AbstractJsonMapping {
private static final long serialVersionUID = 1L;
// Properties
@JsonProperty("id")
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}

@ -0,0 +1,88 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.person.PersonFind;
import com.omertron.themoviedbapi.model2.tv.TVBasic;
import com.omertron.themoviedbapi.model2.tv.TVEpisodeBasic;
import com.omertron.themoviedbapi.model2.tv.TVSeasonBasic;
import java.util.List;
/**
* @author stuart.boston
*/
public class FindResults extends AbstractJsonMapping {
private static final long serialVersionUID = 1L;
@JsonProperty("movie_results")
private List<MovieBasic> movieResults;
@JsonProperty("person_results")
private List<PersonFind> personResults;
@JsonProperty("tv_results")
private List<TVBasic> tvResults;
@JsonProperty("tv_season_results")
private List<TVSeasonBasic> tvSeasonResults;
@JsonProperty("tv_episode_results")
private List<TVEpisodeBasic> tvEpisodeResults;
public List<MovieBasic> getMovieResults() {
return movieResults;
}
public void setMovieResults(List<MovieBasic> movieResults) {
this.movieResults = movieResults;
}
public List<PersonFind> getPersonResults() {
return personResults;
}
public void setPersonResults(List<PersonFind> personResults) {
this.personResults = personResults;
}
public List<TVBasic> getTvResults() {
return tvResults;
}
public void setTvResults(List<TVBasic> tvResults) {
this.tvResults = tvResults;
}
public List<TVSeasonBasic> getTvSeasonResults() {
return tvSeasonResults;
}
public void setTvSeasonResults(List<TVSeasonBasic> tvSeasonResults) {
this.tvSeasonResults = tvSeasonResults;
}
public List<TVEpisodeBasic> getTvEpisodeResults() {
return tvEpisodeResults;
}
public void setTvEpisodeResults(List<TVEpisodeBasic> tvEpisodeResults) {
this.tvEpisodeResults = tvEpisodeResults;
}
}

@ -0,0 +1,117 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.tv.TVBasic;
/**
* Basic media information
*
* @author stuart.boston
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXTERNAL_PROPERTY,
property = "media_type",
defaultImpl = MovieBasic.class
)
@JsonSubTypes({
@Type(value = MovieBasic.class, name = "movie"),
@Type(value = TVBasic.class, name = "tv")
})
public class MediaBasic extends AbstractJsonMapping {
@JsonProperty("id")
private int id;
@JsonProperty("media_type")
private String mediaType;
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("popularity")
private float popularity;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private int voteCount;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getMediaType() {
return mediaType;
}
public void setMediaType(String mediaType) {
this.mediaType = mediaType;
}
public String getBackdropPath() {
return backdropPath;
}
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public String getPosterPath() {
return posterPath;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public float getPopularity() {
return popularity;
}
public void setPopularity(float popularity) {
this.popularity = popularity;
}
public float getVoteAverage() {
return voteAverage;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public int getVoteCount() {
return voteCount;
}
public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}
}

@ -0,0 +1,5 @@
package com.omertron.themoviedbapi.model2;
public class MediaTypeMixIn {
}

@ -19,50 +19,29 @@
*/
package com.omertron.themoviedbapi.model2.movie;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import com.omertron.themoviedbapi.model.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.MediaBasic;
/**
* Movie Favorite information
* Basic Movie information
*
* @author stuart.boston
*/
public class MovieBasic extends AbstractJsonMapping {
public class MovieBasic extends MediaBasic {
@JsonProperty("id")
private int id;
@JsonProperty("adult")
private boolean adult;
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("original_title")
private String originalTitle;
@JsonProperty("release_date")
private String releaseDate;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("popularity")
private float popularity;
@JsonProperty("title")
private String title;
@JsonProperty("video")
private boolean video;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private int voteCount;
@JsonProperty("rating")
private float rating = -1f;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public boolean isAdult() {
return adult;
}
@ -71,14 +50,6 @@ public class MovieBasic extends AbstractJsonMapping {
this.adult = adult;
}
public String getBackdropPath() {
return backdropPath;
}
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public String getOriginalTitle() {
return originalTitle;
}
@ -95,22 +66,6 @@ public class MovieBasic extends AbstractJsonMapping {
this.releaseDate = releaseDate;
}
public String getPosterPath() {
return posterPath;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public float getPopularity() {
return popularity;
}
public void setPopularity(float popularity) {
this.popularity = popularity;
}
public String getTitle() {
return title;
}
@ -127,22 +82,6 @@ public class MovieBasic extends AbstractJsonMapping {
this.video = video;
}
public float getVoteAverage() {
return voteAverage;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public int getVoteCount() {
return voteCount;
}
public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}
public float getRating() {
return rating;
}

@ -27,5 +27,4 @@ import com.omertron.themoviedbapi.model.AbstractIdName;
public class PersonBasic extends AbstractIdName {
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,73 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2.person;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.MediaBasic;
import java.util.List;
/**
* @author stuart.boston
*/
public class PersonFind extends PersonBasic {
private static final long serialVersionUID = 1L;
@JsonProperty("adult")
private Boolean adult;
@JsonProperty("popularity")
private Float popularity;
@JsonProperty("profile_path")
private String profilePath;
@JsonProperty("known_for")
private List<? extends MediaBasic> knownFor;
public Boolean getAdult() {
return adult;
}
public void setAdult(Boolean adult) {
this.adult = adult;
}
public Float getPopularity() {
return popularity;
}
public void setPopularity(Float popularity) {
this.popularity = popularity;
}
public String getProfilePath() {
return profilePath;
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
}
public List<? extends MediaBasic> getKnownFor() {
return knownFor;
}
public void setKnownFor(List<? extends MediaBasic> knownFor) {
this.knownFor = knownFor;
}
}

@ -19,49 +19,28 @@
*/
package com.omertron.themoviedbapi.model2.tv;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import com.omertron.themoviedbapi.model.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.MediaBasic;
import java.util.List;
/**
* TV Favorite information
* Basic TV information
*
* @author stuart.boston
*/
public class TVBasic extends AbstractJsonMapping {
public class TVBasic extends MediaBasic {
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
@JsonProperty("original_name")
private String originalName;
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private int voteCount;
@JsonProperty("first_air_date")
private String firstAirDate;
@JsonProperty("popularity")
private float popularity;
@JsonProperty("origin_country")
private List<String> originCountry;
@JsonProperty("rating")
private float rating = -1f;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
@ -78,38 +57,6 @@ public class TVBasic extends AbstractJsonMapping {
this.originalName = originalName;
}
public String getBackdropPath() {
return backdropPath;
}
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public String getPosterPath() {
return posterPath;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public float getVoteAverage() {
return voteAverage;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public int getVoteCount() {
return voteCount;
}
public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}
public String getFirstAirDate() {
return firstAirDate;
}
@ -118,14 +65,6 @@ public class TVBasic extends AbstractJsonMapping {
this.firstAirDate = firstAirDate;
}
public float getPopularity() {
return popularity;
}
public void setPopularity(float popularity) {
this.popularity = popularity;
}
public List<String> getOriginCountry() {
return originCountry;
}

@ -32,6 +32,7 @@ public enum MethodBase {
CONFIGURATION("configuration"),
CREDIT("credit"),
DISCOVER("discover"),
FIND("find"),
GENRE("genre"),
JOB("job"),
KEYWORD("keyword"),

@ -34,6 +34,7 @@ public enum Param {
APPEND("append_to_response="),
COUNTRY("country="),
END_DATE("end_date="),
EXTERNAL_SOURCE("external_source="),
FAVORITE("favorite="),
ID("id="),
INCLUDE_ALL_MOVIES("include_all_movies="),

@ -0,0 +1,70 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi;
public class TestID {
private String name;
private String imdb;
private int tmdb;
private String other = null;
public TestID() {
}
public TestID(String name, String imdb, int tmdb) {
this.name = name;
this.imdb = imdb;
this.tmdb = tmdb;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getImdb() {
return imdb;
}
public void setImdb(String imdb) {
this.imdb = imdb;
}
public int getTmdb() {
return tmdb;
}
public void setTmdb(int tmdb) {
this.tmdb = tmdb;
}
public String getOther() {
return other;
}
public void setOther(String other) {
this.other = other;
}
}

@ -21,9 +21,18 @@ package com.omertron.themoviedbapi.methods;
import com.omertron.themoviedbapi.AbstractTests;
import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.TestID;
import com.omertron.themoviedbapi.enumeration.ExternalSource;
import com.omertron.themoviedbapi.model2.FindResults;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.person.PersonFind;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.fail;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@ -36,6 +45,9 @@ import org.junit.Test;
public class TmdbFindTest extends AbstractTests {
private static TmdbFind instance;
private static final List<TestID> PERSON_IDS = new ArrayList<TestID>();
private static final List<TestID> FILM_IDS = new ArrayList<TestID>();
private static final List<TestID> TV_IDS = new ArrayList<TestID>();
public TmdbFindTest() {
}
@ -44,6 +56,15 @@ public class TmdbFindTest extends AbstractTests {
public static void setUpClass() throws MovieDbException {
doConfiguration();
instance = new TmdbFind(getApiKey(), getHttpTools());
PERSON_IDS.add(new TestID("Mila Kunis", "nm0005109", 18973));
PERSON_IDS.add(new TestID("Andrew Lincoln", "nm0511088", 7062));
FILM_IDS.add(new TestID("Jupiter Ascending", "tt1617661", 76757));
FILM_IDS.add(new TestID("Lucy", "tt2872732", 240832));
TV_IDS.add(new TestID("The Walking Dead", "tt1520211", 1402));
TV_IDS.add(new TestID("Supernatural", "tt0460681", 1622));
}
@AfterClass
@ -59,32 +80,76 @@ public class TmdbFindTest extends AbstractTests {
}
/**
* Test of getMovieChangesList method, of class TmdbFindTest.
* Test of Find Movie
*
* @throws MovieDbException
*/
@Test
// @Test
public void testFindMoviesImdbID() throws MovieDbException {
LOG.info("findMoviesImdbID");
// TBD_FindResults result = instance.find("tt0196229", TBD_ExternalSource.imdb_id, "it");
// assertFalse("No movie for id.", result.getMovieResults().isEmpty());
fail("The test case is a prototype.");
FindResults result;
for (TestID test : FILM_IDS) {
result = instance.find(test.getImdb(), ExternalSource.IMDB_ID, LANGUAGE_DEFAULT);
assertFalse("No movie for ID " + test.getName(), result.getMovieResults().isEmpty());
boolean found = false;
for (MovieBasic m : result.getMovieResults()) {
if (m.getId() == test.getTmdb()) {
found = true;
break;
}
}
assertTrue("No movie found: " + test.getName(), found);
}
}
/**
* Test of Find Person
*
* @throws MovieDbException
* @throws IOException
*/
// @Test
public void testFindPersonImdbID() throws MovieDbException, IOException {
LOG.info("findPersonImdbID");
FindResults result;
for (TestID test : PERSON_IDS) {
result = instance.find(test.getImdb(), ExternalSource.IMDB_ID, LANGUAGE_DEFAULT);
assertFalse("No person for ID: " + test.getName(), result.getPersonResults().isEmpty());
boolean found = false;
for (PersonFind p : result.getPersonResults()) {
if (p.getId() == test.getTmdb()) {
found = true;
break;
}
}
assertTrue("No person found for ID: " + test.getName(), found);
}
}
/**
* Test of Find TV
*
* @throws MovieDbException
*/
@Test
public void testFindTvSeriesImdbID() throws MovieDbException {
LOG.info("findTvSeriesImdbID");
// TBD_FindResults result = instance.find("tt1219024", TBD_ExternalSource.imdb_id, "it");
// assertFalse("No tv for id.", result.getTvResults().isEmpty());
fail("The test case is a prototype.");
}
FindResults result;
@Test
public void testFindPersonImdbID() throws MovieDbException {
LOG.info("findPersonImdbID");
// TBD_FindResults result = instance.find("nm0001774", TBD_ExternalSource.imdb_id, "it");
// assertFalse("No person for id.", result.getPersonResults().isEmpty());
fail("The test case is a prototype.");
for (TestID test : TV_IDS) {
result = instance.find(test.getImdb(), ExternalSource.IMDB_ID, LANGUAGE_DEFAULT);
assertFalse("No TV Show for ID: " + test.getName(), result.getPersonResults().isEmpty());
boolean found = false;
for (PersonFind p : result.getPersonResults()) {
if (p.getId() == test.getTmdb()) {
found = true;
break;
}
}
assertTrue("No TV Show found for ID: " + test.getName(), found);
}
}
}

Loading…
Cancel
Save