[jira] [Commented] (KAFKA-14969) Upgrade Mockito to 4.11.0
[ https://issues.apache.org/jira/browse/KAFKA-14969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17760919#comment-17760919 ] Ismael Juma commented on KAFKA-14969: - I removed the fix version. > Upgrade Mockito to 4.11.0 > - > > Key: KAFKA-14969 > URL: https://issues.apache.org/jira/browse/KAFKA-14969 > Project: Kafka > Issue Type: Improvement > Components: unit tests >Reporter: Divij Vaidya >Priority: Minor > Labels: dependencies > > Upgrading to Mockito 4.11.0 leads to following errors. Need to fix them > before upgrade. Note that we cannot upgrade to Mockito 5 because it doesn't > support JDK 8. > {code:java} > [2023-05-05T12:21:58.628Z] > Task :core:compileTestScala > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2654:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2658:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2688:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2692:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2728:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2734:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:807:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:838:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread){code} > {code:java} > [2023-05-05T12:22:40.865Z] > Task :core:compileTestScala > [2023-05-05T12:22:40.865Z] [Error] > /home/jenkins/jenkins-agent/712657a4
[jira] [Commented] (KAFKA-14969) Upgrade Mockito to 4.11.0
[ https://issues.apache.org/jira/browse/KAFKA-14969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17760813#comment-17760813 ] Satish Duggana commented on KAFKA-14969: [~ijuma] Can you please update the JIRA with the latest status? > Upgrade Mockito to 4.11.0 > - > > Key: KAFKA-14969 > URL: https://issues.apache.org/jira/browse/KAFKA-14969 > Project: Kafka > Issue Type: Improvement > Components: unit tests >Reporter: Divij Vaidya >Priority: Minor > Labels: dependencies > Fix For: 3.6.0 > > > Upgrading to Mockito 4.11.0 leads to following errors. Need to fix them > before upgrade. Note that we cannot upgrade to Mockito 5 because it doesn't > support JDK 8. > {code:java} > [2023-05-05T12:21:58.628Z] > Task :core:compileTestScala > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2654:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2658:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2688:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2692:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2728:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2734:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:807:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:838:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread){code} > {code:java} > [2023-05-05T12:22:40.865Z] > Task :core:compileTestScala >
[jira] [Commented] (KAFKA-14969) Upgrade Mockito to 4.11.0
[ https://issues.apache.org/jira/browse/KAFKA-14969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17746830#comment-17746830 ] Said BOUDJELDA commented on KAFKA-14969: Thank you [~ijuma] I just saw the comments in the code {code:java} // We use Mockito 4.11 with Scala 2.13+ for Java 20 support and Mockito 4.9 with Scala 2.12 // to workaround ambiguous reference to `Mockito.spy` compiler errors. Since Scala 2.12 support // is going away soon, this is simpler than adjusting the code. String mockitoVersion if (scalaVersion == "2.12") mockitoVersion = "4.9.0" else mockitoVersion = "4.11.0"{code} > Upgrade Mockito to 4.11.0 > - > > Key: KAFKA-14969 > URL: https://issues.apache.org/jira/browse/KAFKA-14969 > Project: Kafka > Issue Type: Improvement > Components: unit tests >Reporter: Divij Vaidya >Priority: Minor > Labels: dependencies > Fix For: 3.6.0 > > > Upgrading to Mockito 4.11.0 leads to following errors. Need to fix them > before upgrade. Note that we cannot upgrade to Mockito 5 because it doesn't > support JDK 8. > {code:java} > [2023-05-05T12:21:58.628Z] > Task :core:compileTestScala > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2654:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2658:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2688:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2692:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2728:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2734:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:807:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:838:21: > ambiguous reference to
[jira] [Commented] (KAFKA-14969) Upgrade Mockito to 4.11.0
[ https://issues.apache.org/jira/browse/KAFKA-14969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17746711#comment-17746711 ] Ismael Juma commented on KAFKA-14969: - This is sort of done already: https://github.com/apache/kafka/blob/trunk/gradle/dependencies.gradle#L63 > Upgrade Mockito to 4.11.0 > - > > Key: KAFKA-14969 > URL: https://issues.apache.org/jira/browse/KAFKA-14969 > Project: Kafka > Issue Type: Improvement > Components: unit tests >Reporter: Divij Vaidya >Priority: Minor > Labels: dependencies > Fix For: 3.6.0 > > > Upgrading to Mockito 4.11.0 leads to following errors. Need to fix them > before upgrade. Note that we cannot upgrade to Mockito 5 because it doesn't > support JDK 8. > {code:java} > [2023-05-05T12:21:58.628Z] > Task :core:compileTestScala > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2654:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2658:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2688:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2692:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2728:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2734:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:807:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:838:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread){code} > {code:java} > [2023-05-05T12:22:40.865
[jira] [Commented] (KAFKA-14969) Upgrade Mockito to 4.11.0
[ https://issues.apache.org/jira/browse/KAFKA-14969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17746667#comment-17746667 ] Said BOUDJELDA commented on KAFKA-14969: Can I take this ticket, and prepare even the most recent Mockito versions upgrades > Upgrade Mockito to 4.11.0 > - > > Key: KAFKA-14969 > URL: https://issues.apache.org/jira/browse/KAFKA-14969 > Project: Kafka > Issue Type: Improvement > Components: unit tests >Reporter: Divij Vaidya >Priority: Minor > Labels: dependencies > Fix For: 3.6.0 > > > Upgrading to Mockito 4.11.0 leads to following errors. Need to fix them > before upgrade. Note that we cannot upgrade to Mockito 5 because it doesn't > support JDK 8. > {code:java} > [2023-05-05T12:21:58.628Z] > Task :core:compileTestScala > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2654:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2658:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2688:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2692:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2728:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2734:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:807:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:838:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread){code} > {code:java} > [2023-05-05T12:22:40.865Z] > Task :cor
[jira] [Commented] (KAFKA-14969) Upgrade Mockito to 4.11.0
[ https://issues.apache.org/jira/browse/KAFKA-14969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17719865#comment-17719865 ] Ismael Juma commented on KAFKA-14969: - I thought we should go straight to 5.x when we drop support for Java 8. Unless these issues are also present with Mockito 5 and Java 11 (it wasn't clear to me). > Upgrade Mockito to 4.11.0 > - > > Key: KAFKA-14969 > URL: https://issues.apache.org/jira/browse/KAFKA-14969 > Project: Kafka > Issue Type: Improvement > Components: unit tests >Reporter: Divij Vaidya >Priority: Minor > Fix For: 3.6.0 > > > Upgrading to Mockito 4.11.0 leads to following errors. Need to fix them > before upgrade. Note that we cannot upgrade to Mockito 5 because it doesn't > support JDK 8. > {code:java} > [2023-05-05T12:21:58.628Z] > Task :core:compileTestScala > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2654:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2658:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2688:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2692:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2728:31: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types > (kafka.server.metadata.MockConfigRepository) > [2023-05-05T12:21:58.628Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:2734:25: > ambiguous reference to overloaded definition, > [2023-05-05T12:21:58.628Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:21:58.628Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:21:58.628Z] match argument types (kafka.log.LogManager) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:807:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread) > [2023-05-05T12:22:06.267Z] [Error] > /home/jenkins/jenkins-agent/712657a4/workspace/Kafka_kafka-pr_PR-13673/core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:838:21: > ambiguous reference to overloaded definition, > [2023-05-05T12:22:06.267Z] both method spy in class Mockito of type [T](x$1: > T*)T > [2023-05-05T12:22:06.267Z] and method spy in class Mockito of type [T](x$1: > T)T > [2023-05-05T12:22:06.267Z] match argument types > (controller.eventManager.ControllerEventThread){code} > {code:java} > [2