3pacccccc commented on code in PR #25036:
URL: https://github.com/apache/pulsar/pull/25036#discussion_r2587250457


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionTest.java:
##########
@@ -330,6 +331,21 @@ public void testCreateTransactionSystemTopic() throws 
Exception {
             assertEquals(e.getMessage(), "Cannot create topic in system topic 
format!");
         }
     }
+    @Test(timeOut = 10000)
+    public void testAckTnxWithNullMessageId() throws Exception {
+        final String topic = 
BrokerTestUtil.newUniqueName("persistent://tnx/ns1/testAckTnxWithNullMessageId");
+        @Cleanup final Consumer<String> consumer = 
pulsarClient.newConsumer(Schema.STRING)
+                .topic(topic)
+                .subscriptionName("sub1")
+                .subscribe();
+        List<MessageId> messageIdList = null;
+        assertThatThrownBy(
+                () -> consumer.acknowledgeAsync(messageIdList, null).get()

Review Comment:
   Thanks for the feedback @BewareMyPower 
   
   Actually, in this test, the main point is that the ```messageIdList``` is 
null. The test is designed to verify that passing a null ```messageIdList``` to 
```acknowledgeAsync()``` triggers the expected ```InvalidMessageException```, 
regardless of whether the ```Transaction``` parameter is null or not.
   
   I named the test ```testAckTnxWithNullMessageId``` because the method 
signature includes both ```messageIdList``` and ```Transaction```, but the 
focus is really on the ```messageIdList``` validation.
   
   To make it clearer, I’m happy to rename the test to something like:
   ```testAcknowledgeAsyncWithNullMessageIdList()``` – would that help avoid 
confusion?
   
   Let me know if you'd prefer that update, or if you have other suggestions!



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