nastra commented on code in PR #9782:
URL: https://github.com/apache/iceberg/pull/9782#discussion_r1559605425
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -2329,6 +2330,46 @@ public void
multipleDiffsAgainstMultipleTablesLastFails() {
assertThat(schema2.columns()).hasSize(1);
}
+ @Test
+ public void testPaginationForListNameSpaces() {
+ RESTCatalogAdapter adapter = Mockito.spy(new
RESTCatalogAdapter(backendCatalog));
+ RESTCatalog catalog =
+ new RESTCatalog(SessionCatalog.SessionContext.createEmpty(), (config)
-> adapter);
+ catalog.initialize("test",
ImmutableMap.of(RESTSessionCatalog.REST_PAGE_SIZE, "10"));
+ int numberOfItems = 100;
+ String namespaceName = "newdb";
+
+ // create several namespaces for listing and verify
+ for (int i = 0; i < numberOfItems; i++) {
+ String nameSpaceName = namespaceName + i;
+ catalog.createNamespace(Namespace.of(nameSpaceName));
+ }
+
+ List<Namespace> results = catalog.listNamespaces();
+ assertThat(results.size()).isEqualTo(numberOfItems);
Review Comment:
```suggestion
assertThat(results).hasSize(numberOfItems);
```
same for other assertions
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]