chore: resolve ambiguous method reference#8078
Merged
Merged
Conversation
Almog Gavra (agavra)
approved these changes
Aug 30, 2021
John Roesler (vvcephei)
approved these changes
Aug 30, 2021
John Roesler (vvcephei)
left a comment
Member
There was a problem hiding this comment.
Thanks, leah (@lct45) . This seems like it would work.
Another (maybe better) way is to actually bind the type, which you can do with a cast or using the argument matcher that takes a class reference. I'll leave it to you if you prefer that. I think it's fine either way.
Author
|
John Roesler (@vvcephei) I thought about doing that, the matcher that takes a class for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the jenkins job that builds ksql off the latest kafka, there were failures due to ambiguous method reference. In AK PR #9769, a new
DescribeTopicsmethod was added toAdmin.java. This made ourKafkaClientTopicImpltest fail because we mocked withany()in theDescribeTopicsmethod call, which now map sto two methods ->describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions)anddescribeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions)This PR specifies that we should be looking for a
Collection.The test errors were:
[2021-08-29T16:07:40.085Z] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project ksqldb-engine: Compilation failure: Compilation failure: [2021-08-29T16:07:40.085Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[112,21] reference to describeTopics is ambiguous [2021-08-29T16:07:40.085Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match [2021-08-29T16:07:40.085Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[196,21] reference to describeTopics is ambiguous [2021-08-29T16:07:40.086Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match [2021-08-29T16:07:40.086Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[205,34] reference to describeTopics is ambiguous [2021-08-29T16:07:40.086Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match [2021-08-29T16:07:40.086Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[282,21] reference to describeTopics is ambiguous [2021-08-29T16:07:40.086Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match [2021-08-29T16:07:40.086Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[291,34] reference to describeTopics is ambiguous [2021-08-29T16:07:40.086Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match [2021-08-29T16:07:40.086Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[297,21] reference to describeTopics is ambiguous [2021-08-29T16:07:40.086Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match [2021-08-29T16:07:40.086Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[314,21] reference to describeTopics is ambiguous [2021-08-29T16:07:40.086Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match [2021-08-29T16:07:40.086Z] [ERROR] /home/jenkins/workspace/apache-kafka-to-ksql-test_trunk/ksql-master/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java:[813,34] reference to describeTopics is ambiguous [2021-08-29T16:07:40.086Z] [ERROR] both method describeTopics(java.util.Collection<java.lang.String>,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin and method describeTopics(org.apache.kafka.common.TopicCollection,org.apache.kafka.clients.admin.DescribeTopicsOptions) in org.apache.kafka.clients.admin.Admin match