From e118f56f99b51bfefc636991ecd42e5122219c4c Mon Sep 17 00:00:00 2001 From: Stuart Boston Date: Mon, 2 Mar 2015 20:14:59 +0000 Subject: [PATCH] fixed Search --- .../omertron/themoviedbapi/methods/AbstractMethod.java | 8 ++++++-- .../omertron/themoviedbapi/methods/TmdbSearchTest.java | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java index ce864bf8a..0a12e1a9a 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java @@ -24,7 +24,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.model.MovieDb; import com.omertron.themoviedbapi.model2.keyword.Keyword; -import com.omertron.themoviedbapi.model.person.Person; +import com.omertron.themoviedbapi.model2.person.Person; import com.omertron.themoviedbapi.model2.collection.Collection; import com.omertron.themoviedbapi.model2.company.Company; import com.omertron.themoviedbapi.model2.list.UserList; @@ -79,7 +79,11 @@ public class AbstractMethod { } protected static TypeReference getTypeReference(Class aClass) { - return TYPE_REFS.get(aClass); + if (TYPE_REFS.containsKey(aClass)) { + return TYPE_REFS.get(aClass); + } else { + throw new RuntimeException("Class type reference for '" + aClass.getSimpleName() + "' not found!"); + } } /** diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java index 054e3b412..2dc6c1891 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java @@ -47,7 +47,6 @@ import org.junit.Test; */ public class TmdbSearchTest extends AbstractTests { - // API private static TmdbSearch instance; private static final String COMPANY_NAME = "Marvel Studios";