ijuma commented on a change in pull request #9912: URL: https://github.com/apache/kafka/pull/9912#discussion_r563459295
########## File path: core/src/test/scala/unit/kafka/server/KafkaApisTest.scala ########## @@ -227,37 +225,33 @@ class KafkaApisTest { authorizeResource(authorizer, operation, ResourceType.TOPIC, resourceName, AuthorizationResult.ALLOWED) - val capturedResponse = expectNoThrottling() - val configResource = new ConfigResource(ConfigResource.Type.TOPIC, resourceName) EasyMock.expect(adminManager.alterConfigs(anyObject(), EasyMock.eq(false))) .andAnswer(() => { Map(configResource -> alterConfigHandler.apply()) }) - EasyMock.replay(replicaManager, clientRequestQuotaManager, requestChannel, authorizer, - adminManager, controller) - val configs = Map( configResource -> new AlterConfigsRequest.Config( Seq(new AlterConfigsRequest.ConfigEntry("foo", "bar")).asJava)) val alterConfigsRequest = new AlterConfigsRequest.Builder(configs.asJava, false).build(requestHeader.apiVersion) val request = buildRequestWithEnvelope(alterConfigsRequest, fromPrivilegedListener = true) + val capturedResponse = EasyMock.newCapture[AbstractResponse]() + val capturedRequest = EasyMock.newCapture[RequestChannel.Request]() - createKafkaApis(authorizer = Some(authorizer), enableForwarding = true).handle(request) - - val envelopeRequest = request.body[EnvelopeRequest] - val response = readResponse(envelopeRequest, capturedResponse) - .asInstanceOf[EnvelopeResponse] - - assertEquals(Errors.NONE, response.error) Review comment: Thanks for the explanation. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org