Skip to content

Commit 9c9c5c4

Browse files
committed
Collection: assert pagination headers for movies
1 parent 0893daf commit 9c9c5c4

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,23 @@ private void assertLastActivityUpdated(LastActivityUpdated activity) {
189189
public void test_collectionMovies() throws IOException {
190190
// Get metadata to assert it can be parsed.
191191
// On the test account, Star Wars: The Force Awakens has all properties set.
192-
List<BaseMovie> movies = executeCall(getTrakt().sync().collectionMovies(1, 1000, Extended.METADATA));
193-
assertSyncMovies(movies, "collection");
192+
Response<List<BaseMovie>> response = executeCallWithoutReadingBody(
193+
getTrakt().sync().collectionMovies(PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, Extended.METADATA));
194+
195+
assertListPaginationHeaders(response);
196+
assertSyncMovies(response.body(), "collection");
194197
}
195198

196199
@Test
197200
public void test_collectionShows() throws IOException {
198201
// Get metadata to assert it can be parsed.
199202
// On the test account, episode 1x08 of Start Trek: Starfleet Academy has all properties set.
200-
List<BaseShow> shows = executeCall(getTrakt().sync().collectionShows(1, 1000, Extended.METADATA));
201-
assertSyncShows(shows, "collection");
203+
Response<List<BaseShow>> response = executeCallWithoutReadingBody(
204+
getTrakt().sync().collectionShows(PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, Extended.METADATA));
205+
206+
// As of 2026-03-06, when filtering to shows pagination appears to be not supported (yet?)
207+
// assertListPaginationHeaders(response);
208+
assertSyncShows(response.body(), "collection");
202209
}
203210

204211
@Test

src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,21 @@ public void test_profile() throws IOException {
104104

105105
@Test
106106
public void test_collectionMovies() throws IOException {
107-
List<BaseMovie> movies = executeCall(
108-
getTrakt().users().collectionMovies(TestData.USER_SLUG, 1, 1000, null));
109-
assertSyncMovies(movies, "collection");
107+
Response<List<BaseMovie>> response = executeCallWithoutReadingBody(
108+
getTrakt().users().collectionMovies(TestData.USER_SLUG, PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, null));
109+
110+
assertListPaginationHeaders(response);
111+
assertSyncMovies(response.body(), "collection");
110112
}
111113

112114
@Test
113115
public void test_collectionShows() throws IOException {
114-
List<BaseShow> shows = executeCall(getTrakt().users().collectionShows(TestData.USER_SLUG, 1, 1000, null));
115-
assertSyncShows(shows, "collection");
116+
Response<List<BaseShow>> response = executeCallWithoutReadingBody(
117+
getTrakt().users().collectionShows(TestData.USER_SLUG, PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, null));
118+
119+
// As of 2026-03-06, when filtering to shows pagination appears to be not supported (yet?)
120+
// assertListPaginationHeaders(response);
121+
assertSyncShows(response.body(), "collection");
116122
}
117123

118124
@Test

0 commit comments

Comments
 (0)