Copilot commented on code in PR #10292:
URL: https://github.com/apache/rocketmq/pull/10292#discussion_r3213391958


##########
client/src/main/java/org/apache/rocketmq/client/impl/MQAdminImpl.java:
##########
@@ -320,7 +320,7 @@ public MessageExt queryMessageByUniqKey(String clusterName, 
String topic,
 
     public QueryResult queryMessage(String clusterName, String topic, String 
key, int maxNum, long begin, long end, boolean isUniqKey) throws 
MQClientException,
         InterruptedException {
-        return queryMessage(clusterName, topic, key, maxNum, begin, end, 
isUniqKey, null, null);
+        return queryMessage(clusterName, topic, key, maxNum, begin, end, 
isUniqKey, isUniqKey ? MessageConst.INDEX_UNIQUE_TYPE : 
MessageConst.INDEX_KEY_TYPE, null);
     }

Review Comment:
   Add unit coverage for the `queryMessage(String clusterName, ..., boolean 
isUniqKey)` overload to ensure the defaulted `indexType` behavior is correct 
(e.g., when `isUniqKey=false` it should behave like `INDEX_KEY_TYPE`). Current 
`MQAdminImplTest` only exercises the topic-only overload and uniqKey helpers, 
so this regression path would not be caught.



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