rahil-c commented on code in PR #9782: URL: https://github.com/apache/iceberg/pull/9782#discussion_r1567854386
########## core/src/test/java/org/apache/iceberg/rest/responses/TestListTablesResponse.java: ########## @@ -105,9 +105,32 @@ public void testBuilderDoesNotCreateInvalidObjects() { .hasMessage("Invalid table identifier: null"); } + @Test + public void testWithNullPaginationToken() throws JsonProcessingException { + String jsonWithNullPageToken = + "{\"identifiers\":[{\"namespace\":[\"accounting\",\"tax\"],\"name\":\"paid\"}],\"next-page-token\":null}"; + ListTablesResponse response = + ListTablesResponse.builder().addAll(IDENTIFIERS).nextPageToken(null).build(); + assertRoundTripSerializesEquallyFrom(jsonWithNullPageToken, response); + Assertions.assertThat(response.nextPageToken()).isNull(); + Assertions.assertThat(response.identifiers()).isEqualTo(IDENTIFIERS); + } + + @Test + public void testWithPaginationToken() throws JsonProcessingException { + String pageToken = "token"; + String jsonWithPageToken = + "{\"identifiers\":[{\"namespace\":[\"accounting\",\"tax\"],\"name\":\"paid\"}],\"next-page-token\":\"token\"}"; + ListTablesResponse response = + ListTablesResponse.builder().addAll(IDENTIFIERS).nextPageToken(pageToken).build(); + assertRoundTripSerializesEquallyFrom(jsonWithPageToken, response); + Assertions.assertThat(response.nextPageToken()).isNotNull(); Review Comment: will fix -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org