TaiJuWu commented on code in PR #18850:
URL: https://github.com/apache/kafka/pull/18850#discussion_r1949481278


##########
clients/src/test/java/org/apache/kafka/clients/consumer/ConsumerConfigTest.java:
##########
@@ -240,20 +240,33 @@ public void testProtocolConfigValidation(String protocol, 
boolean isValid) {
 
     @Test
     public void testUnsupportedConfigsWithConsumerGroupProtocol() {
-        
testUnsupportedConfigsWithConsumerGroupProtocol(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,
 "RoundRobinAssignor");
-        
testUnsupportedConfigsWithConsumerGroupProtocol(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG,
 1000);
-        
testUnsupportedConfigsWithConsumerGroupProtocol(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG,
 30000);
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.CONSUMER, 
ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG, "RoundRobinAssignor");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.CONSUMER, 
ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 1000);
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.CONSUMER, 
ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, 30000);
     }
 
-    private void testUnsupportedConfigsWithConsumerGroupProtocol(String 
configName, Object value) {
+    @Test
+    public void testUnsupportedConfigsWithShareGroupProtocol() {
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.GROUP_INSTANCE_ID_CONFIG, "1");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.ISOLATION_LEVEL_CONFIG, "read_committed");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG, 
"org.apache.kafka.clients.consumer.StickyAssignor");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG, 
"org.apache.kafka.clients.consumer.ConsumerInterceptor");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "3000");
+        testUnsupportedConfigsWithGroupProtocol(GroupProtocol.SHARE, 
ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 3000);
+    }
+
+    private void testUnsupportedConfigsWithGroupProtocol(GroupProtocol 
groupProtocol, String configName, Object value) {
         final Map<String, Object> configs = Map.of(
                 ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, 
keyDeserializerClass,
                 ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, 
valueDeserializerClass,
-                ConsumerConfig.GROUP_PROTOCOL_CONFIG, 
GroupProtocol.CONSUMER.name(),
+                ConsumerConfig.GROUP_PROTOCOL_CONFIG, groupProtocol.name(),
+                ConsumerConfig.GROUP_ID_CONFIG, "1",

Review Comment:
   This is need change for test `ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG`



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