From d254e851dd10977c34781c2daa8c16631bc39436 Mon Sep 17 00:00:00 2001 From: Leah Thomas Date: Mon, 30 Aug 2021 11:14:49 -0500 Subject: [PATCH] chore: resolve ambiguous method reference --- .../ksql/services/KafkaTopicClientImplTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java b/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java index 1476dbb46fd0..4d674778cb7a 100644 --- a/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java +++ b/ksqldb-engine/src/test/java/io/confluent/ksql/services/KafkaTopicClientImplTest.java @@ -23,6 +23,7 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThrows; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyCollection; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyMap; import static org.mockito.ArgumentMatchers.argThat; @@ -109,7 +110,7 @@ public void setUp() { topicConfigs.clear(); when(adminClient.listTopics()).thenAnswer(listTopicResult()); - when(adminClient.describeTopics(any(), any())).thenAnswer(describeTopicsResult()); + when(adminClient.describeTopics(anyCollection(), any())).thenAnswer(describeTopicsResult()); when(adminClient.createTopics(any(), any())).thenAnswer(createTopicsResult()); when(adminClient.deleteTopics(any(Collection.class))).thenAnswer(deleteTopicsResult()); when(adminClient.describeConfigs(any())).thenAnswer(describeConfigsResult()); @@ -193,7 +194,7 @@ public void shouldRetryDescribeTopicDuringCreateTopicOnRetryableException() { // Given: givenTopicExists("topicName", 1, 2); - when(adminClient.describeTopics(any(), any())) + when(adminClient.describeTopics(anyCollection(), any())) .thenAnswer(describeTopicsResult()) // checks that topic exists .thenAnswer(describeTopicsResult(new UnknownTopicOrPartitionException("meh"))) // fails during validateProperties .thenAnswer(describeTopicsResult()); // succeeds the third time @@ -202,7 +203,7 @@ public void shouldRetryDescribeTopicDuringCreateTopicOnRetryableException() { kafkaTopicClient.createTopic("topicName", 1, (short) 2); // Then: - verify(adminClient, times(3)).describeTopics(any(), any()); + verify(adminClient, times(3)).describeTopics(anyCollection(), any()); } @Test @@ -279,7 +280,7 @@ public void shouldRetryDescribeTopicDuringValidateCreateTopicOnRetryableExceptio // Given: givenTopicExists("topicName", 1, 2); - when(adminClient.describeTopics(any(), any())) + when(adminClient.describeTopics(anyCollection(), any())) .thenAnswer(describeTopicsResult()) // checks that topic exists .thenAnswer(describeTopicsResult(new UnknownTopicOrPartitionException("meh"))) // fails during validateProperties .thenAnswer(describeTopicsResult()); // succeeds the third time @@ -288,13 +289,13 @@ public void shouldRetryDescribeTopicDuringValidateCreateTopicOnRetryableExceptio kafkaTopicClient.validateCreateTopic("topicName", 1, (short) 2); // Then: - verify(adminClient, times(3)).describeTopics(any(), any()); + verify(adminClient, times(3)).describeTopics(anyCollection(), any()); } @Test public void shouldThrowOnDescribeTopicsWhenRetriesExpire() { // Given: - when(adminClient.describeTopics(any(), any())) + when(adminClient.describeTopics(anyCollection(), any())) .thenAnswer(describeTopicsResult(new UnknownTopicOrPartitionException("meh"))) .thenAnswer(describeTopicsResult(new UnknownTopicOrPartitionException("meh"))) .thenAnswer(describeTopicsResult(new UnknownTopicOrPartitionException("meh"))) @@ -311,7 +312,7 @@ public void shouldThrowOnDescribeTopicsWhenRetriesExpire() { @Test public void shouldThrowOnDescribeOnTopicAuthorizationException() { // Given: - when(adminClient.describeTopics(any(), any())) + when(adminClient.describeTopics(anyCollection(), any())) .thenAnswer(describeTopicsResult(new TopicAuthorizationException("meh"))); // When: @@ -810,7 +811,7 @@ public void shouldNotRetryIsTopicExistsOnUnknownTopicException() { kafkaTopicClient.isTopicExists("foobar"); // Then - verify(adminClient, times(1)).describeTopics(any(), any()); + verify(adminClient, times(1)).describeTopics(anyCollection(), any()); } @Test