From 9c9c5c47f9e9edaff2506d5b4e93d59c30793614 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Thu, 19 Feb 2026 09:09:17 +0100 Subject: [PATCH 1/2] Collection: assert pagination headers for movies --- .../uwetrottmann/trakt5/services/SyncTest.java | 15 +++++++++++---- .../uwetrottmann/trakt5/services/UsersTest.java | 16 +++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java b/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java index 6859aef8..2d0491e8 100644 --- a/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java +++ b/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java @@ -189,16 +189,23 @@ private void assertLastActivityUpdated(LastActivityUpdated activity) { public void test_collectionMovies() throws IOException { // Get metadata to assert it can be parsed. // On the test account, Star Wars: The Force Awakens has all properties set. - List movies = executeCall(getTrakt().sync().collectionMovies(1, 1000, Extended.METADATA)); - assertSyncMovies(movies, "collection"); + Response> response = executeCallWithoutReadingBody( + getTrakt().sync().collectionMovies(PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, Extended.METADATA)); + + assertListPaginationHeaders(response); + assertSyncMovies(response.body(), "collection"); } @Test public void test_collectionShows() throws IOException { // Get metadata to assert it can be parsed. // On the test account, episode 1x08 of Start Trek: Starfleet Academy has all properties set. - List shows = executeCall(getTrakt().sync().collectionShows(1, 1000, Extended.METADATA)); - assertSyncShows(shows, "collection"); + Response> response = executeCallWithoutReadingBody( + getTrakt().sync().collectionShows(PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, Extended.METADATA)); + + // As of 2026-03-06, when filtering to shows pagination appears to be not supported (yet?) + // assertListPaginationHeaders(response); + assertSyncShows(response.body(), "collection"); } @Test diff --git a/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java b/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java index aec161cf..c6b35c34 100644 --- a/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java +++ b/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java @@ -104,15 +104,21 @@ public void test_profile() throws IOException { @Test public void test_collectionMovies() throws IOException { - List movies = executeCall( - getTrakt().users().collectionMovies(TestData.USER_SLUG, 1, 1000, null)); - assertSyncMovies(movies, "collection"); + Response> response = executeCallWithoutReadingBody( + getTrakt().users().collectionMovies(TestData.USER_SLUG, PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, null)); + + assertListPaginationHeaders(response); + assertSyncMovies(response.body(), "collection"); } @Test public void test_collectionShows() throws IOException { - List shows = executeCall(getTrakt().users().collectionShows(TestData.USER_SLUG, 1, 1000, null)); - assertSyncShows(shows, "collection"); + Response> response = executeCallWithoutReadingBody( + getTrakt().users().collectionShows(TestData.USER_SLUG, PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, null)); + + // As of 2026-03-06, when filtering to shows pagination appears to be not supported (yet?) + // assertListPaginationHeaders(response); + assertSyncShows(response.body(), "collection"); } @Test From ccc86b475dfcd8526a63af60ab4e10ed5e702e99 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Fri, 6 Mar 2026 11:01:58 +0100 Subject: [PATCH 2/2] Collection: assert pagination headers for shows --- src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java | 3 +-- src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java b/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java index 2d0491e8..80c40fef 100644 --- a/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java +++ b/src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java @@ -203,8 +203,7 @@ public void test_collectionShows() throws IOException { Response> response = executeCallWithoutReadingBody( getTrakt().sync().collectionShows(PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, Extended.METADATA)); - // As of 2026-03-06, when filtering to shows pagination appears to be not supported (yet?) - // assertListPaginationHeaders(response); + assertListPaginationHeaders(response); assertSyncShows(response.body(), "collection"); } diff --git a/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java b/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java index c6b35c34..4c8f21f6 100644 --- a/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java +++ b/src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java @@ -116,8 +116,7 @@ public void test_collectionShows() throws IOException { Response> response = executeCallWithoutReadingBody( getTrakt().users().collectionShows(TestData.USER_SLUG, PAGE_ONE, LIST_AND_COLLECTION_MAX_LIMIT, null)); - // As of 2026-03-06, when filtering to shows pagination appears to be not supported (yet?) - // assertListPaginationHeaders(response); + assertListPaginationHeaders(response); assertSyncShows(response.body(), "collection"); }