-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from c-eg/keywords-api
Keywords api
- Loading branch information
Showing
4 changed files
with
50 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
src/main/java/info/movito/themoviedbapi/model/keywords/KeywordMovie.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/test/java/info/movito/themoviedbapi/TmdbKeywordsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package info.movito.themoviedbapi; | ||
|
||
import info.movito.themoviedbapi.model.keywords.Keyword; | ||
import info.movito.themoviedbapi.tools.RequestType; | ||
import info.movito.themoviedbapi.tools.TmdbException; | ||
import info.movito.themoviedbapi.util.TestUtils; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
import static info.movito.themoviedbapi.TmdbKeywords.TMDB_METHOD_KEYWORD; | ||
import static info.movito.themoviedbapi.tools.ApiUrl.TMDB_API_BASE_URL; | ||
import static info.movito.themoviedbapi.util.TestUtils.testForNullFieldsAndNewItems; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.mockito.Mockito.when; | ||
|
||
/** | ||
* Tests for {@link TmdbKeywords}. | ||
*/ | ||
public class TmdbKeywordsTest extends AbstractTmdbApiTest { | ||
/** | ||
* Tests {@link TmdbKeywords#getDetails(int)} with an expected result. | ||
*/ | ||
@Test | ||
public void testGetDetails() throws TmdbException, IOException { | ||
String body = TestUtils.readTestFile("api_responses/keywords/details.json"); | ||
URL url = new URL(TMDB_API_BASE_URL + TMDB_METHOD_KEYWORD + "/1"); | ||
when(getTmdbUrlReader().readUrl(url, null, RequestType.GET)).thenReturn(body); | ||
|
||
TmdbKeywords tmdbKeywords = getTmdbApi().getKeywords(); | ||
Keyword keyword = tmdbKeywords.getDetails(1); | ||
assertNotNull(keyword); | ||
testForNullFieldsAndNewItems(keyword); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"id": 1701, | ||
"name": "hero" | ||
} |