diff --git a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java index 56bea5abf..bdb729d53 100644 --- a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java +++ b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java @@ -42,7 +42,6 @@ import com.omertron.themoviedbapi.methods.TmdbPeople; import com.omertron.themoviedbapi.methods.TmdbReviews; import com.omertron.themoviedbapi.methods.TmdbSearch; import com.omertron.themoviedbapi.methods.TmdbTV; -import com.omertron.themoviedbapi.model.AlternativeTitle; import com.omertron.themoviedbapi.model.Genre; import com.omertron.themoviedbapi.model.MovieDb; import com.omertron.themoviedbapi.model.MovieList; @@ -52,7 +51,7 @@ import com.omertron.themoviedbapi.model.Video; import com.omertron.themoviedbapi.model.keyword.KeywordMovie; import com.omertron.themoviedbapi.model2.Certification; import com.omertron.themoviedbapi.model2.FindResults; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; import com.omertron.themoviedbapi.model2.StatusCode; import com.omertron.themoviedbapi.model2.account.Account; import com.omertron.themoviedbapi.model2.artwork.Artwork; @@ -69,11 +68,10 @@ import com.omertron.themoviedbapi.model2.discover.Discover; import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model2.list.ListItem; import com.omertron.themoviedbapi.model2.list.UserList; +import com.omertron.themoviedbapi.model2.movie.AlternativeTitle; import com.omertron.themoviedbapi.model2.movie.MovieBasic; import com.omertron.themoviedbapi.model2.network.Network; import com.omertron.themoviedbapi.model2.person.CreditInfo; -import com.omertron.themoviedbapi.model2.person.CreditMovieBasic; -import com.omertron.themoviedbapi.model2.person.CreditTVBasic; import com.omertron.themoviedbapi.model2.person.ExternalID; import com.omertron.themoviedbapi.model2.person.Person; import com.omertron.themoviedbapi.model2.person.PersonCredits; @@ -1225,7 +1223,7 @@ public class TheMovieDbApi { * @return * @throws MovieDbException */ - public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException { return tmdbPeople.getPersonMovieCredits(personId, language, appendToResponse); } @@ -1244,7 +1242,7 @@ public class TheMovieDbApi { * @return * @throws MovieDbException */ - public PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + public PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException { return tmdbPeople.getPersonTVCredits(personId, language, appendToResponse); } @@ -1263,7 +1261,7 @@ public class TheMovieDbApi { * @return * @throws MovieDbException */ - public PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + public PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException { return tmdbPeople.getPersonCombinedCredits(personId, language, appendToResponse); } diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java index b07ee8e46..2e14e95b2 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java @@ -20,16 +20,17 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.MovieDbException; -import com.omertron.themoviedbapi.model.AlternativeTitle; import com.omertron.themoviedbapi.model.MovieDb; import com.omertron.themoviedbapi.model.MovieList; import com.omertron.themoviedbapi.model.ReleaseInfo; import com.omertron.themoviedbapi.model.Translation; import com.omertron.themoviedbapi.model.Video; -import com.omertron.themoviedbapi.model.person.Person; +import com.omertron.themoviedbapi.model2.media.MediaState; import com.omertron.themoviedbapi.model2.StatusCode; import com.omertron.themoviedbapi.model2.artwork.Artwork; import com.omertron.themoviedbapi.model2.keyword.Keyword; +import com.omertron.themoviedbapi.model2.media.MediaCreditList; +import com.omertron.themoviedbapi.model2.movie.AlternativeTitle; import com.omertron.themoviedbapi.results.TmdbResultsList; import com.omertron.themoviedbapi.tools.ApiUrl; import com.omertron.themoviedbapi.tools.HttpTools; @@ -42,7 +43,6 @@ import com.omertron.themoviedbapi.tools.TmdbParameters; import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles; import com.omertron.themoviedbapi.wrapper.WrapperImages; import com.omertron.themoviedbapi.wrapper.WrapperMovie; -import com.omertron.themoviedbapi.wrapper.WrapperMovieCasts; import com.omertron.themoviedbapi.wrapper.WrapperMovieKeywords; import com.omertron.themoviedbapi.wrapper.WrapperMovieList; import com.omertron.themoviedbapi.wrapper.WrapperReleaseInfo; @@ -150,14 +150,19 @@ public class TmdbMovies extends AbstractMethod { * @return * @throws MovieDbException */ - public String getMovieAccountState(int movieId, String sessionId) throws MovieDbException { + public MediaState getMovieAccountState(int movieId, String sessionId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, movieId); parameters.add(Param.SESSION, sessionId); - URL url = new ApiUrl(apiKey, MethodBase.MOVIE).buildUrl(parameters); + URL url = new ApiUrl(apiKey, MethodBase.MOVIE).setSubMethod(MethodSub.ACCOUNT_STATES).buildUrl(parameters); String webpage = httpTools.getRequest(url); - return null; + + try { + return MAPPER.readValue(webpage, MediaState.class); + } catch (IOException ex) { + throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie info", url, ex); + } } /** @@ -196,41 +201,17 @@ public class TmdbMovies extends AbstractMethod { * @return * @throws MovieDbException */ - public String getMovieCredits(int movieId, String... appendToResponse) throws MovieDbException { + public MediaCreditList getMovieCredits(int movieId, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, movieId); parameters.add(Param.APPEND, appendToResponse); - URL url = new ApiUrl(apiKey, MethodBase.MOVIE).buildUrl(parameters); + URL url = new ApiUrl(apiKey, MethodBase.MOVIE).setSubMethod(MethodSub.CREDITS).buildUrl(parameters); String webpage = httpTools.getRequest(url); - return null; - } - - /** - * Get the cast information for a specific movie id. - * - * TODO: Add a function to enrich the data with the people methods - * - * @param movieId - * @param appendToResponse - * @return - * @throws MovieDbException - */ - public TmdbResultsList getMovieCasts(int movieId, String... appendToResponse) throws MovieDbException { - TmdbParameters parameters = new TmdbParameters(); - parameters.add(Param.ID, movieId); - parameters.add(Param.APPEND, appendToResponse); - - URL url = new ApiUrl(apiKey, MethodBase.MOVIE).setSubMethod(MethodSub.CASTS).buildUrl(parameters); - String webpage = httpTools.getRequest(url); - try { - WrapperMovieCasts wrapper = MAPPER.readValue(webpage, WrapperMovieCasts.class); - TmdbResultsList results = new TmdbResultsList(wrapper.getAll()); - results.copyWrapper(wrapper); - return results; + return MAPPER.readValue(webpage, MediaCreditList.class); } catch (IOException ex) { - throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie casts", url, ex); + throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie credits", url, ex); } } diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java index 9141d4b2e..4f0817681 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java @@ -24,9 +24,6 @@ import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.enumeration.ArtworkType; import com.omertron.themoviedbapi.model2.artwork.Artwork; import com.omertron.themoviedbapi.model2.artwork.ArtworkMedia; -import com.omertron.themoviedbapi.model2.person.CreditBasic; -import com.omertron.themoviedbapi.model2.person.CreditMovieBasic; -import com.omertron.themoviedbapi.model2.person.CreditTVBasic; import com.omertron.themoviedbapi.model2.person.ExternalID; import com.omertron.themoviedbapi.model2.person.Person; import com.omertron.themoviedbapi.model2.person.PersonCredits; @@ -94,7 +91,7 @@ public class TmdbPeople extends AbstractMethod { * @return * @throws MovieDbException */ - public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, personId); parameters.add(Param.LANGUAGE, language); @@ -104,8 +101,7 @@ public class TmdbPeople extends AbstractMethod { String webpage = httpTools.getRequest(url); try { - return MAPPER.readValue(webpage, new TypeReference>() { - }); + return MAPPER.readValue(webpage, PersonCredits.class); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person movie credits", url, ex); } @@ -126,7 +122,7 @@ public class TmdbPeople extends AbstractMethod { * @return * @throws MovieDbException */ - public PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + public PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, personId); parameters.add(Param.LANGUAGE, language); @@ -136,8 +132,7 @@ public class TmdbPeople extends AbstractMethod { String webpage = httpTools.getRequest(url); try { - return MAPPER.readValue(webpage, new TypeReference>() { - }); + return MAPPER.readValue(webpage, PersonCredits.class); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person TV credits", url, ex); } @@ -158,7 +153,7 @@ public class TmdbPeople extends AbstractMethod { * @return * @throws MovieDbException */ - public PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + public PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, personId); parameters.add(Param.LANGUAGE, language); @@ -168,8 +163,7 @@ public class TmdbPeople extends AbstractMethod { String webpage = httpTools.getRequest(url); try { - return MAPPER.readValue(webpage, new TypeReference>() { - }); + return MAPPER.readValue(webpage, PersonCredits.class); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person combined credits", url, ex); } diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java index 1a25409c7..106de17a1 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java @@ -23,7 +23,7 @@ import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.enumeration.SearchType; import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER; import com.omertron.themoviedbapi.model.MovieDb; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model2.collection.Collection; import com.omertron.themoviedbapi.model2.company.Company; diff --git a/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java b/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java index 35ae03da9..909cd92c6 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java +++ b/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java @@ -19,14 +19,15 @@ */ package com.omertron.themoviedbapi.model; -import com.omertron.themoviedbapi.model2.artwork.Artwork; -import com.omertron.themoviedbapi.model2.review.Review; -import com.omertron.themoviedbapi.model2.AbstractJsonMapping; -import com.omertron.themoviedbapi.model2.collection.Collection; -import com.omertron.themoviedbapi.model2.keyword.Keyword; +import com.fasterxml.jackson.annotation.JsonProperty; import com.omertron.themoviedbapi.model.person.PersonCast; import com.omertron.themoviedbapi.model.person.PersonCrew; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model2.AbstractJsonMapping; +import com.omertron.themoviedbapi.model2.artwork.Artwork; +import com.omertron.themoviedbapi.model2.collection.Collection; +import com.omertron.themoviedbapi.model2.keyword.Keyword; +import com.omertron.themoviedbapi.model2.movie.AlternativeTitle; +import com.omertron.themoviedbapi.model2.review.Review; import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles; import com.omertron.themoviedbapi.wrapper.WrapperImages; import com.omertron.themoviedbapi.wrapper.WrapperMovie; diff --git a/src/main/java/com/omertron/themoviedbapi/model2/artwork/ArtworkMedia.java b/src/main/java/com/omertron/themoviedbapi/model2/artwork/ArtworkMedia.java index 75ac96bd6..48e96b0f2 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/artwork/ArtworkMedia.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/artwork/ArtworkMedia.java @@ -24,7 +24,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.omertron.themoviedbapi.enumeration.MediaType; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; import com.omertron.themoviedbapi.model2.movie.MovieBasic; import com.omertron.themoviedbapi.model2.tv.TVBasic; import com.omertron.themoviedbapi.model2.tv.TVEpisodeBasic; diff --git a/src/main/java/com/omertron/themoviedbapi/model2/MediaBasic.java b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaBasic.java similarity index 95% rename from src/main/java/com/omertron/themoviedbapi/model2/MediaBasic.java rename to src/main/java/com/omertron/themoviedbapi/model2/media/MediaBasic.java index d430c3f2a..d7547ca47 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/MediaBasic.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaBasic.java @@ -17,9 +17,10 @@ * along with TheMovieDB API. If not, see . * */ -package com.omertron.themoviedbapi.model2; +package com.omertron.themoviedbapi.model2.media; import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model2.AbstractJsonMapping; /** * Basic media information diff --git a/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCredit.java b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCredit.java new file mode 100644 index 000000000..b20087c0a --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCredit.java @@ -0,0 +1,72 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.model2.media; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model2.AbstractJsonMapping; + +/** + * + * @author Stuart.Boston + */ +public class MediaCredit extends AbstractJsonMapping { + + @JsonProperty("credit_id") + private String creditId; + @JsonProperty("id") + private int id; + @JsonProperty("profile_path") + private String profilePath; + @JsonProperty("name") + private String name; + + public String getCreditId() { + return creditId; + } + + public void setCreditId(String creditId) { + this.creditId = creditId; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getProfilePath() { + return profilePath; + } + + public void setProfilePath(String profilePath) { + this.profilePath = profilePath; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditCast.java b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditCast.java new file mode 100644 index 000000000..b3646a574 --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditCast.java @@ -0,0 +1,61 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.model2.media; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Stuart.Boston + */ +public class MediaCreditCast extends MediaCredit { + + @JsonProperty("cast_id") + private int castId = 0; + @JsonProperty("character") + private String character; + @JsonProperty("order") + private int order; + + public int getCastId() { + return castId; + } + + public void setCastId(int castId) { + this.castId = castId; + } + + public String getCharacter() { + return character; + } + + public void setCharacter(String character) { + this.character = character; + } + + public int getOrder() { + return order; + } + + public void setOrder(int order) { + this.order = order; + } + +} diff --git a/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditCrew.java b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditCrew.java new file mode 100644 index 000000000..733a9ac99 --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditCrew.java @@ -0,0 +1,51 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.model2.media; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Stuart.Boston + */ +public class MediaCreditCrew extends MediaCredit { + + @JsonProperty("department") + private String department; + @JsonProperty("job") + private String job; + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getJob() { + return job; + } + + public void setJob(String job) { + this.job = job; + } + +} diff --git a/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditList.java b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditList.java new file mode 100644 index 000000000..396351cf4 --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaCreditList.java @@ -0,0 +1,64 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.model2.media; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model2.AbstractJsonMapping; +import java.util.List; + +/** + * @author stuart.boston + */ +public class MediaCreditList extends AbstractJsonMapping { + + private static final long serialVersionUID = 1L; + + @JsonProperty("id") + private int id; + @JsonProperty("cast") + private List cast; + @JsonProperty("crew") + private List crew; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public List getCast() { + return cast; + } + + public void setCast(List cast) { + this.cast = cast; + } + + public List getCrew() { + return crew; + } + + public void setCrew(List crew) { + this.crew = crew; + } + +} diff --git a/src/main/java/com/omertron/themoviedbapi/model2/media/MediaState.java b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaState.java new file mode 100644 index 000000000..aee208f64 --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/model2/media/MediaState.java @@ -0,0 +1,85 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.model2.media; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model2.AbstractJsonMapping; + +/** + * + * @author Stuart.Boston + */ +public class MediaState extends AbstractJsonMapping { + + @JsonProperty("id") + private int id; + @JsonProperty("favorite") + private boolean favorite; + @JsonProperty("watchlist") + private boolean watchlist; + @JsonProperty("rated") + private RatedValue rated; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public boolean isFavorite() { + return favorite; + } + + public void setFavorite(boolean favorite) { + this.favorite = favorite; + } + + public boolean isWatchlist() { + return watchlist; + } + + public void setWatchlist(boolean watchlist) { + this.watchlist = watchlist; + } + + public float getRated() { + return rated.getValue(); + } + + public void setRated(RatedValue rated) { + this.rated = rated; + } + + public class RatedValue extends AbstractJsonMapping { + + @JsonProperty("value") + private float value = -1f; + + public float getValue() { + return value; + } + + public void setValue(float value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/AlternativeTitle.java b/src/main/java/com/omertron/themoviedbapi/model2/movie/AlternativeTitle.java similarity index 97% rename from src/main/java/com/omertron/themoviedbapi/model/AlternativeTitle.java rename to src/main/java/com/omertron/themoviedbapi/model2/movie/AlternativeTitle.java index 8e5d68085..1132ae483 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/AlternativeTitle.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/movie/AlternativeTitle.java @@ -17,7 +17,7 @@ * along with TheMovieDB API. If not, see . * */ -package com.omertron.themoviedbapi.model; +package com.omertron.themoviedbapi.model2.movie; import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; diff --git a/src/main/java/com/omertron/themoviedbapi/model2/movie/MovieBasic.java b/src/main/java/com/omertron/themoviedbapi/model2/movie/MovieBasic.java index b6a7456a3..09c370997 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/movie/MovieBasic.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/movie/MovieBasic.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.model2.movie; import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; /** * Basic Movie information diff --git a/src/main/java/com/omertron/themoviedbapi/model2/person/PersonCredits.java b/src/main/java/com/omertron/themoviedbapi/model2/person/PersonCredits.java index 9db75621d..07e85541f 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/person/PersonCredits.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/person/PersonCredits.java @@ -24,23 +24,19 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.omertron.themoviedbapi.model2.AbstractJsonMapping; -import com.omertron.themoviedbapi.model2.MediaBasic; import java.util.List; /** * @author stuart.boston - * @param */ -public class PersonCredits extends AbstractJsonMapping { +public class PersonCredits extends AbstractJsonMapping { private static final long serialVersionUID = 1L; @JsonProperty("id") private int id; -// @JsonProperty("cast") - private List cast; -// @JsonProperty("crew") - private List crew; + private List cast; + private List crew; public int getId() { return id; @@ -50,7 +46,7 @@ public class PersonCredits extends AbstractJsonMapping { this.id = id; } - public List getCast() { + public List getCast() { return cast; } @@ -58,18 +54,18 @@ public class PersonCredits extends AbstractJsonMapping { use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "media_type", - defaultImpl = MediaBasic.class + defaultImpl = CreditBasic.class ) @JsonSubTypes({ @JsonSubTypes.Type(value = CreditMovieBasic.class, name = "movie"), @JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv") }) @JsonSetter("cast") - public void setCast(List cast) { + public void setCast(List cast) { this.cast = cast; } - public List getCrew() { + public List getCrew() { return crew; } @@ -77,14 +73,14 @@ public class PersonCredits extends AbstractJsonMapping { use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "media_type", - defaultImpl = MediaBasic.class + defaultImpl = CreditBasic.class ) @JsonSubTypes({ @JsonSubTypes.Type(value = CreditMovieBasic.class, name = "movie"), @JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv") }) @JsonSetter("crew") - public void setCrew(List crew) { + public void setCrew(List crew) { this.crew = crew; } } diff --git a/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java b/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java index 879226e51..c86a659a5 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java @@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; import com.omertron.themoviedbapi.model2.movie.MovieBasic; import com.omertron.themoviedbapi.model2.tv.TVBasic; import com.omertron.themoviedbapi.model2.tv.TVEpisodeBasic; diff --git a/src/main/java/com/omertron/themoviedbapi/model2/tv/TVBasic.java b/src/main/java/com/omertron/themoviedbapi/model2/tv/TVBasic.java index 3df890205..00bbfd70e 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/tv/TVBasic.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/tv/TVBasic.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.model2.tv; import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; import java.util.List; /** diff --git a/src/main/java/com/omertron/themoviedbapi/model2/tv/TVEpisodeBasic.java b/src/main/java/com/omertron/themoviedbapi/model2/tv/TVEpisodeBasic.java index 9854bf559..f884b83d5 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/tv/TVEpisodeBasic.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/tv/TVEpisodeBasic.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.model2.tv; import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; /** * TV Favorite information diff --git a/src/main/java/com/omertron/themoviedbapi/tools/MethodSub.java b/src/main/java/com/omertron/themoviedbapi/tools/MethodSub.java index b015f7f29..cc1d0f4bd 100644 --- a/src/main/java/com/omertron/themoviedbapi/tools/MethodSub.java +++ b/src/main/java/com/omertron/themoviedbapi/tools/MethodSub.java @@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils; public enum MethodSub { + ACCOUNT_STATES("account_states"), ADD_ITEM("add_item"), ALT_TITLES("alternative_titles"), CASTS("casts"), diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java index b4ff2f086..7ad460f2b 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.wrapper; import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.AlternativeTitle; +import com.omertron.themoviedbapi.model2.movie.AlternativeTitle; import java.io.Serializable; import java.util.List; diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMultiSearch.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMultiSearch.java index a4dde1eb1..c6f5af1a6 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMultiSearch.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMultiSearch.java @@ -22,7 +22,7 @@ package com.omertron.themoviedbapi.wrapper; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; import com.omertron.themoviedbapi.model2.movie.MovieBasic; import com.omertron.themoviedbapi.model2.tv.TVBasic; import com.omertron.themoviedbapi.model2.tv.TVEpisodeBasic; diff --git a/src/test/java/com/omertron/themoviedbapi/TestID.java b/src/test/java/com/omertron/themoviedbapi/TestID.java index 1c30381a0..9f2c932a1 100644 --- a/src/test/java/com/omertron/themoviedbapi/TestID.java +++ b/src/test/java/com/omertron/themoviedbapi/TestID.java @@ -24,7 +24,7 @@ public class TestID { private String name; private String imdb; private int tmdb; - private String other = null; + private String other; public TestID() { } @@ -35,6 +35,13 @@ public class TestID { this.tmdb = tmdb; } + public TestID(String name, String imdb, int tmdb, String other) { + this.name = name; + this.imdb = imdb; + this.tmdb = tmdb; + this.other = other; + } + public String getName() { return name; } diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java index eb558e776..1018697f5 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java @@ -22,18 +22,25 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.AbstractTests; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.TestID; -import com.omertron.themoviedbapi.model.AlternativeTitle; import com.omertron.themoviedbapi.model.MovieDb; import com.omertron.themoviedbapi.model.MovieList; import com.omertron.themoviedbapi.model.ReleaseInfo; import com.omertron.themoviedbapi.model.Translation; import com.omertron.themoviedbapi.model.Video; -import com.omertron.themoviedbapi.model.person.Person; import com.omertron.themoviedbapi.model2.artwork.Artwork; import com.omertron.themoviedbapi.model2.keyword.Keyword; +import com.omertron.themoviedbapi.model2.media.MediaCreditCast; +import com.omertron.themoviedbapi.model2.media.MediaCreditList; +import com.omertron.themoviedbapi.model2.media.MediaState; +import com.omertron.themoviedbapi.model2.movie.AlternativeTitle; import com.omertron.themoviedbapi.results.TmdbResultsList; import java.util.ArrayList; import java.util.List; +import java.util.Random; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.junit.BeforeClass; import org.junit.Test; @@ -55,9 +62,9 @@ public class TmdbMoviesTest extends AbstractTests { doConfiguration(); instance = new TmdbMovies(getApiKey(), getHttpTools()); - FILM_IDS.add(new TestID("Blade Runner", "", 78)); - FILM_IDS.add(new TestID("Jupiter Ascending", "tt1617661", 76757)); - FILM_IDS.add(new TestID("Lucy", "tt2872732", 240832)); + FILM_IDS.add(new TestID("Blade Runner", "tt0083658", 78, "Harrison Ford")); + FILM_IDS.add(new TestID("Jupiter Ascending", "tt1617661", 76757, "Mila Kunis")); + FILM_IDS.add(new TestID("Lucy", "tt2872732", 240832, "Morgan Freeman")); } @@ -66,18 +73,19 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieInfo() throws MovieDbException { LOG.info("getMovieInfo"); - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { MovieDb result = instance.getMovieInfo(test.getTmdb(), language, appendToResponse); + assertEquals("Wrong IMDB ID", test.getImdb(), result.getImdbID()); + assertEquals("Wrong title", test.getName(), result.getTitle()); + } - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -85,17 +93,17 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieInfoImdb() throws MovieDbException { LOG.info("getMovieInfoImdb"); - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { MovieDb result = instance.getMovieInfoImdb(test.getImdb(), language, appendToResponse); + assertEquals("Wrong TMDB ID", test.getTmdb(), result.getId()); + assertEquals("Wrong title", test.getName(), result.getTitle()); } - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -103,15 +111,15 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieAccountState() throws MovieDbException { LOG.info("getMovieAccountState"); for (TestID test : FILM_IDS) { - String result = instance.getMovieAccountState(test.getTmdb(), getSessionId()); + MediaState result = instance.getMovieAccountState(test.getTmdb(), getSessionId()); + assertNotNull("Null result", result); + assertTrue("Invalid rating", result.getRated() > -2f); } - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -119,7 +127,7 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieAlternativeTitles() throws MovieDbException { LOG.info("getMovieAlternativeTitles"); @@ -128,9 +136,8 @@ public class TmdbMoviesTest extends AbstractTests { for (TestID test : FILM_IDS) { TmdbResultsList result = instance.getMovieAlternativeTitles(test.getTmdb(), country, appendToResponse); + assertFalse("No alt titles", result.isEmpty()); } - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -138,35 +145,29 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieCredits() throws MovieDbException { LOG.info("getMovieCredits"); String[] appendToResponse = null; for (TestID test : FILM_IDS) { - String result = instance.getMovieCredits(test.getTmdb(), appendToResponse); + MediaCreditList result = instance.getMovieCredits(test.getTmdb(), appendToResponse); + assertNotNull(result); + assertFalse(result.getCast().isEmpty()); + + boolean found = false; + for (MediaCreditCast p : result.getCast()) { + if (test.getOther().equals(p.getName())) { + found = true; + break; + } + } + assertTrue(test.getOther() + " not found in cast!", found); + + assertFalse(result.getCrew().isEmpty()); + break; } - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); - } - - /** - * Test of getMovieCasts method, of class TmdbMovies. - * - * @throws com.omertron.themoviedbapi.MovieDbException - */ - @Test - public void testGetMovieCasts() throws MovieDbException { - LOG.info("getMovieCasts"); - - String[] appendToResponse = null; - - for (TestID test : FILM_IDS) { - TmdbResultsList result = instance.getMovieCasts(test.getTmdb(), appendToResponse); - } - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -178,7 +179,7 @@ public class TmdbMoviesTest extends AbstractTests { public void testGetMovieImages() throws MovieDbException { LOG.info("getMovieImages"); - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { @@ -193,7 +194,7 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieKeywords() throws MovieDbException { LOG.info("getMovieKeywords"); @@ -211,11 +212,11 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieReleaseInfo() throws MovieDbException { LOG.info("getMovieReleaseInfo"); - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { @@ -230,11 +231,11 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieVideos() throws MovieDbException { LOG.info("getMovieVideos"); - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { @@ -249,7 +250,7 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieTranslations() throws MovieDbException { LOG.info("getMovieTranslations"); @@ -267,12 +268,12 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetSimilarMovies() throws MovieDbException { LOG.info("getSimilarMovies"); Integer page = null; - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { @@ -287,12 +288,12 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieReviews() throws MovieDbException { LOG.info("getMovieReviews"); Integer page = null; - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { @@ -307,12 +308,12 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieLists() throws MovieDbException { LOG.info("getMovieLists"); Integer page = null; - String language = ""; + String language = LANGUAGE_DEFAULT; String[] appendToResponse = null; for (TestID test : FILM_IDS) { @@ -327,7 +328,7 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetMovieChanges() throws MovieDbException { LOG.info("getMovieChanges"); @@ -346,14 +347,13 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testPostMovieRating() throws MovieDbException { LOG.info("postMovieRating"); - String sessionId = ""; - Integer rating = null; + Integer rating = new Random().nextInt(10) + 1; for (TestID test : FILM_IDS) { - boolean result = instance.postMovieRating(sessionId, test.getTmdb(), rating); + boolean result = instance.postMovieRating(getSessionId(), test.getTmdb(), rating); } // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); @@ -364,7 +364,7 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetLatestMovie() throws MovieDbException { LOG.info("getLatestMovie"); @@ -380,11 +380,11 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetUpcoming() throws MovieDbException { LOG.info("getUpcoming"); Integer page = null; - String language = ""; + String language = LANGUAGE_DEFAULT; for (TestID test : FILM_IDS) { TmdbResultsList result = instance.getUpcoming(page, language); @@ -398,11 +398,11 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetNowPlayingMovies() throws MovieDbException { LOG.info("getNowPlayingMovies"); Integer page = null; - String language = ""; + String language = LANGUAGE_DEFAULT; for (TestID test : FILM_IDS) { TmdbResultsList result = instance.getNowPlayingMovies(page, language); @@ -416,11 +416,11 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetPopularMovieList() throws MovieDbException { LOG.info("getPopularMovieList"); Integer page = null; - String language = ""; + String language = LANGUAGE_DEFAULT; for (TestID test : FILM_IDS) { TmdbResultsList result = instance.getPopularMovieList(page, language); @@ -434,11 +434,11 @@ public class TmdbMoviesTest extends AbstractTests { * * @throws com.omertron.themoviedbapi.MovieDbException */ - @Test +// @Test public void testGetTopRatedMovies() throws MovieDbException { LOG.info("getTopRatedMovies"); Integer page = null; - String language = ""; + String language = LANGUAGE_DEFAULT; for (TestID test : FILM_IDS) { TmdbResultsList result = instance.getTopRatedMovies(page, language); diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java index 1b7bfc39b..ebecb26ba 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java @@ -27,9 +27,6 @@ import com.omertron.themoviedbapi.model2.artwork.Artwork; import com.omertron.themoviedbapi.model2.artwork.ArtworkMedia; import com.omertron.themoviedbapi.model2.change.ChangeKeyItem; import com.omertron.themoviedbapi.model2.change.ChangeListItem; -import com.omertron.themoviedbapi.model2.person.CreditBasic; -import com.omertron.themoviedbapi.model2.person.CreditMovieBasic; -import com.omertron.themoviedbapi.model2.person.CreditTVBasic; import com.omertron.themoviedbapi.model2.person.ExternalID; import com.omertron.themoviedbapi.model2.person.Person; import com.omertron.themoviedbapi.model2.person.PersonCredits; @@ -121,7 +118,7 @@ public class TmdbPeopleTest extends AbstractTests { String[] appendToResponse = null; for (TestID test : testIDs) { - PersonCredits result = instance.getPersonMovieCredits(test.getTmdb(), language, appendToResponse); + PersonCredits result = instance.getPersonMovieCredits(test.getTmdb(), language, appendToResponse); LOG.info("ID: {}, # Cast: {}, # Crew: {}", result.getId(), result.getCast().size(), result.getCrew().size()); assertEquals("Incorrect ID", test.getTmdb(), result.getId()); assertFalse("No cast", result.getCast().isEmpty()); @@ -141,7 +138,7 @@ public class TmdbPeopleTest extends AbstractTests { String[] appendToResponse = null; for (TestID test : testIDs) { - PersonCredits result = instance.getPersonTVCredits(test.getTmdb(), language, appendToResponse); + PersonCredits result = instance.getPersonTVCredits(test.getTmdb(), language, appendToResponse); LOG.info("ID: {}, # Cast: {}, # Crew: {}", result.getId(), result.getCast().size(), result.getCrew().size()); assertEquals("Incorrect ID", test.getTmdb(), result.getId()); assertFalse("No cast", result.getCast().isEmpty()); @@ -161,7 +158,7 @@ public class TmdbPeopleTest extends AbstractTests { String[] appendToResponse = null; for (TestID test : testIDs) { - PersonCredits result = instance.getPersonCombinedCredits(test.getTmdb(), language, appendToResponse); + PersonCredits result = instance.getPersonCombinedCredits(test.getTmdb(), language, appendToResponse); LOG.info("ID: {}, # Cast: {}, # Crew: {}", result.getId(), result.getCast().size(), result.getCrew().size()); assertEquals("Incorrect ID", test.getTmdb(), result.getId()); assertFalse("No cast", result.getCast().isEmpty()); diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java index b649a3187..697bfcde9 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java @@ -23,7 +23,7 @@ import com.omertron.themoviedbapi.AbstractTests; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.enumeration.SearchType; import com.omertron.themoviedbapi.model.MovieDb; -import com.omertron.themoviedbapi.model2.MediaBasic; +import com.omertron.themoviedbapi.model2.media.MediaBasic; import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model2.collection.Collection; import com.omertron.themoviedbapi.model2.company.Company;