majialoong commented on code in PR #21633:
URL: https://github.com/apache/kafka/pull/21633#discussion_r2896457708
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupConfigManagerTest.java:
##########
@@ -101,27 +129,123 @@ public void testValidateUsesAllGroupTypeDefaults() {
GroupConfigManager.validate(newGroupConfig,
groupCoordinatorConfig, shareGroupConfig));
}
+ /**
+ * Data source for {@link #testConfigClampedToMax} and {@link
#testConfigClampedToMin}.
+ * Each entry: (configKey, tooLow, expectedMin, tooHigh, expectedMax,
getter).
+ */
+ private static Stream<Arguments> clampConfigProvider() {
+ return Stream.of(
+ // Consumer group configs
+ Arguments.of(
+ CONSUMER_SESSION_TIMEOUT_MS_CONFIG,
+ 40000, CONSUMER_GROUP_MIN_SESSION_TIMEOUT_MS_DEFAULT,
+ 70000, CONSUMER_GROUP_MAX_SESSION_TIMEOUT_MS_DEFAULT,
+ (ToIntFunction<GroupConfig>)
GroupConfig::consumerSessionTimeoutMs
+ ),
+ Arguments.of(
+ CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG,
+ 3000, CONSUMER_GROUP_MIN_HEARTBEAT_INTERVAL_MS_DEFAULT,
+ 20000, CONSUMER_GROUP_MAX_HEARTBEAT_INTERVAL_MS_DEFAULT,
+ (ToIntFunction<GroupConfig>)
GroupConfig::consumerHeartbeatIntervalMs
+ ),
+ // Share group configs
+ Arguments.of(
+ SHARE_SESSION_TIMEOUT_MS_CONFIG,
+ 40000, SHARE_GROUP_MIN_SESSION_TIMEOUT_MS_DEFAULT,
+ 70000, SHARE_GROUP_MAX_SESSION_TIMEOUT_MS_DEFAULT,
+ (ToIntFunction<GroupConfig>) GroupConfig::shareSessionTimeoutMs
Review Comment:
Yes, removing the cast triggers a compiler error.
I’ve refactored the code locally to avoid needing the cast, and will push an
updated commit soon. Thanks for the review!
--
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]