This is an automated email from the ASF dual-hosted git repository.

jmclean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 2dceea6287 [#8348] test(server): SchemaUpdatesRequest null updates 
unit test (#10617)
2dceea6287 is described below

commit 2dceea628729534f1ea61fbd39ac049f33b6870c
Author: Babu Mahesh <[email protected]>
AuthorDate: Wed Apr 1 06:45:02 2026 +0530

    [#8348] test(server): SchemaUpdatesRequest null updates unit test (#10617)
    
    ### What changes were proposed in this pull request?
    
    Adds a unit test to verify that SchemaUpdatesRequest properly validates
    null updates and throws an appropriate IllegalArgumentException with a
    descriptive error message.
    
      ### Why are the changes needed?
    
    The SchemaUpdatesRequest.validate() method includes a precondition check
    to ensure the updates field is not null. However, this validation logic
    was not covered by unit tests. This test ensures the precondition is
    correctly
    enforced and provides the expected error message when violated.
    
    ###  How was this patch tested?
    
    New unit test testSchemaUpdatesRequestWithUpdatesNull() in
    TestSchemaOperations verifies:
      - Passing null to SchemaUpdatesRequest constructor
      - Calling validate() throws IllegalArgumentException
    
      All existing unit tests and integration tests pass.
    
      Fix: #8348
    
    Co-authored-by: Babu Mahesh <[email protected]>
---
 .../apache/gravitino/server/web/rest/TestSchemaOperations.java   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/server/src/test/java/org/apache/gravitino/server/web/rest/TestSchemaOperations.java
 
b/server/src/test/java/org/apache/gravitino/server/web/rest/TestSchemaOperations.java
index e619e15816..02ce325f3b 100644
--- 
a/server/src/test/java/org/apache/gravitino/server/web/rest/TestSchemaOperations.java
+++ 
b/server/src/test/java/org/apache/gravitino/server/web/rest/TestSchemaOperations.java
@@ -489,4 +489,13 @@ public class TestSchemaOperations extends 
BaseOperationsTest {
 
     return mockSchema;
   }
+
+  @Test
+  public void testSchemaUpdatesRequestWithUpdatesNull() {
+    SchemaUpdatesRequest schemaUpdatesRequest = new SchemaUpdatesRequest(null);
+
+    Throwable exception =
+        Assertions.assertThrows(IllegalArgumentException.class, 
schemaUpdatesRequest::validate);
+    Assertions.assertEquals("updates must not be null", 
exception.getMessage());
+  }
 }

Reply via email to