You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "dimas-b (via GitHub)" <gi...@apache.org> on 2023/02/01 15:02:05 UTC

[GitHub] [iceberg] dimas-b commented on a diff in pull request #6712: Nessie: Support ApiV2 for Nessie client

dimas-b commented on code in PR #6712:
URL: https://github.com/apache/iceberg/pull/6712#discussion_r1093344545


##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNamespace.java:
##########
@@ -63,14 +65,56 @@ public void testListNamespaces() {
     tables = catalog.listTables(null);
     Assertions.assertThat(tables).isNotNull().hasSize(6);
 
-    List<Namespace> namespaces = catalog.listNamespaces();
-    Assertions.assertThat(namespaces).isNotNull().hasSize(5);
-    namespaces = catalog.listNamespaces(Namespace.of("a"));
-    Assertions.assertThat(namespaces).isNotNull().hasSize(3);
-    namespaces = catalog.listNamespaces(Namespace.of("a", "b"));
-    Assertions.assertThat(namespaces).isNotNull().hasSize(2);
-    namespaces = catalog.listNamespaces(Namespace.of("b"));
-    Assertions.assertThat(namespaces).isNotNull().hasSize(2);
+    List<Namespace> namespaces;
+    if (api instanceof NessieApiV2) {

Review Comment:
   Whenever test logic different, I think it would be nice to have one method for v1 and another for v2, each annotated with `@NessieApiVersions(...)` for its specific target version. Common code could be refactored into utility methods. WDYT?



##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNamespace.java:
##########
@@ -63,14 +65,56 @@ public void testListNamespaces() {
     tables = catalog.listTables(null);
     Assertions.assertThat(tables).isNotNull().hasSize(6);
 
-    List<Namespace> namespaces = catalog.listNamespaces();
-    Assertions.assertThat(namespaces).isNotNull().hasSize(5);
-    namespaces = catalog.listNamespaces(Namespace.of("a"));
-    Assertions.assertThat(namespaces).isNotNull().hasSize(3);
-    namespaces = catalog.listNamespaces(Namespace.of("a", "b"));
-    Assertions.assertThat(namespaces).isNotNull().hasSize(2);
-    namespaces = catalog.listNamespaces(Namespace.of("b"));
-    Assertions.assertThat(namespaces).isNotNull().hasSize(2);
+    List<Namespace> namespaces;
+    if (api instanceof NessieApiV2) {

Review Comment:
   Whenever test logic differs, I think it would be nice to have one method for v1 and another for v2, each annotated with `@NessieApiVersions(...)` for its specific target version. Common code could be refactored into utility methods. WDYT?



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org