yunchipang commented on code in PR #7335:
URL: https://github.com/apache/gravitino/pull/7335#discussion_r2138823090


##########
catalogs/catalog-hadoop/src/test/java/org/apache/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java:
##########
@@ -2663,14 +2699,26 @@ private static Stream<Arguments> testRenameArguments() {
             TEST_ROOT_PATH + "/fileset39"));
   }
 
-  private Schema createSchema(String name, String comment, String catalogPath, 
String schemaPath)
+  private Schema createSchema(
+      long testId, String name, String comment, String catalogPath, String 
schemaPath)
       throws IOException {
-    return createSchema(name, comment, catalogPath, schemaPath, false);
+    return createSchema(testId, name, comment, catalogPath, schemaPath, false);
   }
 
   private Schema createSchema(
-      String name, String comment, String catalogPath, String schemaPath, 
boolean disableFsOps)
+      long testId,
+      String name,
+      String comment,
+      String catalogPath,
+      String schemaPath,
+      boolean disableFsOps)
       throws IOException {
+    // stub schema
+    doReturn(new SchemaIds(1L, 1L, testId))
+        .when(spySchemaMetaService)
+        .getSchemaIdByMetalakeNameAndCatalogNameAndSchemaName(
+            Mockito.anyString(), Mockito.anyString(), Mockito.eq(name));

Review Comment:
   @mchades thanks for the comment. I've moved the schema-stubbing logic into 
`createSchema` so we no longer need to call `stubSchema` in every test. 
`generateTestId` func is added to utilize `idGenerator` to auto-generate test 
ids without manually defining a `testId`. Tests have all passes locally, let me 
know if you have any other suggestions on the design. thanks!



-- 
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]

Reply via email to