DL1231 commented on code in PR #15067: URL: https://github.com/apache/kafka/pull/15067#discussion_r1667582981
########## core/src/test/scala/unit/kafka/server/KafkaApisTest.scala: ########## @@ -489,6 +489,45 @@ class KafkaApisTest extends Logging { testKraftForwarding(ApiKeys.ELECT_LEADERS, requestBuilder) } + @Test + def testIncrementalConsumerGroupAlterConfigs(): Unit = { + val authorizer: Authorizer = mock(classOf[Authorizer]) + + val consumerGroupId = "consumer_group_1" + val resource = new ConfigResource(ConfigResource.Type.GROUP, consumerGroupId) + + authorizeResource(authorizer, AclOperation.ALTER_CONFIGS, ResourceType.GROUP, + consumerGroupId, AuthorizationResult.ALLOWED) + + val requestHeader = new RequestHeader(ApiKeys.INCREMENTAL_ALTER_CONFIGS, + ApiKeys.INCREMENTAL_ALTER_CONFIGS.latestVersion, clientId, 0) + + val incrementalAlterConfigsRequest = getIncrementalConsumerGroupAlterConfigRequestBuilder( + Seq(resource)).build(requestHeader.apiVersion) + val request = buildRequest(incrementalAlterConfigsRequest, + fromPrivilegedListener = true, requestHeader = Option(requestHeader)) + + when(controller.isActive).thenReturn(true) + when(clientRequestQuotaManager.maybeRecordAndGetThrottleTimeMs(any[RequestChannel.Request](), + any[Long])).thenReturn(0) + when(adminManager.incrementalAlterConfigs(any(), ArgumentMatchers.eq(false))) + .thenReturn(Map(resource -> ApiError.NONE)) + + createKafkaApis(authorizer = Some(authorizer)).handleIncrementalAlterConfigsRequest(request) + val response = verifyNoThrottling[IncrementalAlterConfigsResponse](request) + verifyIncrementalAlterConfigResult(response, Map(consumerGroupId -> Errors.NONE )) Review Comment: Done -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org