diff --git a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java index 955c97f2f..315814925 100644 --- a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java +++ b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java @@ -81,7 +81,7 @@ import com.omertron.themoviedbapi.model.review.Review; import com.omertron.themoviedbapi.model.tv.TVBasic; import com.omertron.themoviedbapi.model.tv.TVInfo; import com.omertron.themoviedbapi.results.ResultList; -import com.omertron.themoviedbapi.results.TmdbResultsMap; +import com.omertron.themoviedbapi.results.ResultsMap; import com.omertron.themoviedbapi.tools.HttpTools; import com.omertron.themoviedbapi.tools.MethodBase; import com.omertron.themoviedbapi.wrapper.WrapperChanges; @@ -421,7 +421,7 @@ public class TheMovieDbApi { * @return * @throws MovieDbException */ - public TmdbResultsMap> getMoviesCertification() throws MovieDbException { + public ResultsMap> getMoviesCertification() throws MovieDbException { return tmdbCertifications.getMoviesCertification(); } @@ -431,7 +431,7 @@ public class TheMovieDbApi { * @return * @throws MovieDbException */ - public TmdbResultsMap> getTvCertification() throws MovieDbException { + public ResultsMap> getTvCertification() throws MovieDbException { return tmdbCertifications.getTvCertification(); } // diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java index addd2a02e..8d324dc70 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.MovieDbException; -import com.omertron.themoviedbapi.results.TmdbResultsMap; +import com.omertron.themoviedbapi.results.ResultsMap; import com.omertron.themoviedbapi.tools.HttpTools; import java.util.List; import com.fasterxml.jackson.core.type.TypeReference; @@ -57,7 +57,7 @@ public class TmdbCertifications extends AbstractMethod { * @return * @throws MovieDbException */ - public TmdbResultsMap> getMoviesCertification() throws MovieDbException { + public ResultsMap> getMoviesCertification() throws MovieDbException { URL url = new ApiUrl(apiKey, MethodBase.CERTIFICATION).subMethod(MethodSub.MOVIE_LIST).buildUrl(); String webpage = httpTools.getRequest(url); @@ -65,7 +65,7 @@ public class TmdbCertifications extends AbstractMethod { JsonNode node = MAPPER.readTree(webpage); Map> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference>>() { }); - return new TmdbResultsMap>(results); + return new ResultsMap>(results); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie certifications", url, ex); } @@ -77,7 +77,7 @@ public class TmdbCertifications extends AbstractMethod { * @return * @throws MovieDbException */ - public TmdbResultsMap> getTvCertification() throws MovieDbException { + public ResultsMap> getTvCertification() throws MovieDbException { URL url = new ApiUrl(apiKey, MethodBase.CERTIFICATION).subMethod(MethodSub.TV_LIST).buildUrl(); String webpage = httpTools.getRequest(url); @@ -85,7 +85,7 @@ public class TmdbCertifications extends AbstractMethod { JsonNode node = MAPPER.readTree(webpage); Map> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference>>() { }); - return new TmdbResultsMap>(results); + return new ResultsMap>(results); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV certifications", url, ex); } diff --git a/src/main/java/com/omertron/themoviedbapi/results/TmdbResultsMap.java b/src/main/java/com/omertron/themoviedbapi/results/ResultsMap.java similarity index 92% rename from src/main/java/com/omertron/themoviedbapi/results/TmdbResultsMap.java rename to src/main/java/com/omertron/themoviedbapi/results/ResultsMap.java index a0e0ad3a2..9ec8c00aa 100644 --- a/src/main/java/com/omertron/themoviedbapi/results/TmdbResultsMap.java +++ b/src/main/java/com/omertron/themoviedbapi/results/ResultsMap.java @@ -29,11 +29,11 @@ import java.util.Map; * @param * @param */ -public final class TmdbResultsMap extends AbstractResults { +public final class ResultsMap extends AbstractResults { private Map results; - public TmdbResultsMap(Map resultsMap) { + public ResultsMap(Map resultsMap) { results = new HashMap(resultsMap); } diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java index 34c8e67a7..9a7f2fc61 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java @@ -22,7 +22,7 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.AbstractTests; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.model.Certification; -import com.omertron.themoviedbapi.results.TmdbResultsMap; +import com.omertron.themoviedbapi.results.ResultsMap; import java.util.List; import java.util.Map; import org.junit.AfterClass; @@ -60,7 +60,7 @@ public class TmdbCertificationsTest extends AbstractTests { @Test public void testGetMovieCertifications() throws MovieDbException { LOG.info("getMovieCertifications"); - TmdbResultsMap> result = instance.getMoviesCertification(); + ResultsMap> result = instance.getMoviesCertification(); assertFalse("No movie certifications.", result.getResults().isEmpty()); for (Map.Entry> entry : result.getResults().entrySet()) { LOG.info("{} = {} entries", entry.getKey(), entry.getValue().size()); @@ -76,7 +76,7 @@ public class TmdbCertificationsTest extends AbstractTests { @Test public void testGetTvCertifications() throws MovieDbException { LOG.info("getTvCertifications"); - TmdbResultsMap> result = instance.getTvCertification(); + ResultsMap> result = instance.getTvCertification(); assertFalse("No tv certifications.", result.getResults().isEmpty()); for (Map.Entry> entry : result.getResults().entrySet()) { LOG.info("{} = {} entries", entry.getKey(), entry.getValue().size()); diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbChangesTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbChangesTest.java index 493a85efe..203743ad5 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbChangesTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbChangesTest.java @@ -27,7 +27,6 @@ import com.omertron.themoviedbapi.tools.MethodBase; import org.junit.AfterClass; import static org.junit.Assert.assertFalse; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; /** @@ -60,7 +59,7 @@ public class TmdbChangesTest extends AbstractTests { public void testGetMovieChangesList() throws MovieDbException { LOG.info("getMovieChangesList"); ResultList result = instance.getChangeList(MethodBase.MOVIE, null, null, null); - assertFalse("No movie changes.", result.isEmpty()); + assertFalse("No Movie changes.", result.isEmpty()); } /** @@ -68,7 +67,7 @@ public class TmdbChangesTest extends AbstractTests { * * @throws MovieDbException */ - @Ignore("Not ready yet") + @Test public void testGetPersonChangesList() throws MovieDbException { LOG.info("getPersonChangesList"); ResultList result = instance.getChangeList(MethodBase.PERSON, null, null, null); @@ -80,10 +79,10 @@ public class TmdbChangesTest extends AbstractTests { * * @throws MovieDbException */ - @Ignore("Not ready yet") + @Test public void testGetTVChangesList() throws MovieDbException { - LOG.info("getPersonChangesList"); - ResultList result = instance.getChangeList(MethodBase.PERSON, null, null, null); + LOG.info("getTVChangesList"); + ResultList result = instance.getChangeList(MethodBase.TV, null, null, null); assertFalse("No TV changes.", result.isEmpty()); } }