Skip to content

Commit 3504fc4

Browse files
Merge branch '7.0.x'
2 parents b439b1d + 69ece06 commit 3504fc4

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

kafka-rest/src/test/java/io/confluent/kafkarest/controllers/TopicManagerImplTest.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import static java.util.Collections.singletonList;
2020
import static java.util.Collections.singletonMap;
2121
import static java.util.concurrent.CompletableFuture.completedFuture;
22-
import static org.easymock.EasyMock.anyObject;
2322
import static org.easymock.EasyMock.expect;
23+
import static org.easymock.EasyMock.isA;
2424
import static org.easymock.EasyMock.replay;
2525
import static org.easymock.EasyMock.verify;
2626
import static org.junit.Assert.assertEquals;
@@ -36,6 +36,7 @@
3636
import io.confluent.kafkarest.entities.Topic;
3737
import java.util.ArrayList;
3838
import java.util.Arrays;
39+
import java.util.Collection;
3940
import java.util.Collections;
4041
import java.util.HashMap;
4142
import java.util.HashSet;
@@ -411,7 +412,7 @@ public void listTopics_existingCluster_returnsTopics() throws Exception {
411412
expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.of(CLUSTER)));
412413
expect(adminClient.listTopics()).andReturn(listTopicsResult);
413414
expect(listTopicsResult.listings()).andReturn(KafkaFuture.completedFuture(TOPIC_LISTINGS));
414-
expect(adminClient.describeTopics(anyObject())).andReturn(describeTopicResult);
415+
expect(adminClient.describeTopics(isA(Collection.class))).andReturn(describeTopicResult);
415416
expect(describeTopicResult.all())
416417
.andReturn(
417418
KafkaFuture.completedFuture(
@@ -444,7 +445,7 @@ public void listLocalTopics_returnsTopics() throws Exception {
444445
expect(clusterManager.getLocalCluster()).andReturn(completedFuture(CLUSTER));
445446
expect(adminClient.listTopics()).andReturn(listTopicsResult);
446447
expect(listTopicsResult.listings()).andReturn(KafkaFuture.completedFuture(TOPIC_LISTINGS));
447-
expect(adminClient.describeTopics(anyObject())).andReturn(describeTopicResult);
448+
expect(adminClient.describeTopics(isA(Collection.class))).andReturn(describeTopicResult);
448449
expect(describeTopicResult.all())
449450
.andReturn(
450451
KafkaFuture.completedFuture(
@@ -473,7 +474,7 @@ public void listTopic_nonExistingCluster_throwsNotFoundException() throws Except
473474
@Test
474475
public void getTopic_existingTopic_returnsTopic() throws Exception {
475476
expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.of(CLUSTER)));
476-
expect(adminClient.describeTopics(anyObject())).andReturn(describeTopicResult);
477+
expect(adminClient.describeTopics(isA(Collection.class))).andReturn(describeTopicResult);
477478
expect(describeTopicResult.all())
478479
.andReturn(KafkaFuture.completedFuture(createTopicDescriptionMap(TOPIC_DESCRIPTION_1)));
479480
replay(clusterManager, adminClient, describeTopicResult);
@@ -486,7 +487,7 @@ public void getTopic_existingTopic_returnsTopic() throws Exception {
486487
@Test
487488
public void getTopic_nonExistingCluster_throwsNotFoundException() throws Exception {
488489
expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.empty()));
489-
expect(adminClient.describeTopics(anyObject())).andReturn(describeTopicResult);
490+
expect(adminClient.describeTopics(isA(Collection.class))).andReturn(describeTopicResult);
490491
replay(clusterManager);
491492

492493
try {
@@ -500,7 +501,7 @@ public void getTopic_nonExistingCluster_throwsNotFoundException() throws Excepti
500501
@Test
501502
public void getTopic_nonExistingTopic_returnsEmpty() throws Exception {
502503
expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.of(CLUSTER)));
503-
expect(adminClient.describeTopics(anyObject())).andReturn(describeTopicResult);
504+
expect(adminClient.describeTopics(isA(Collection.class))).andReturn(describeTopicResult);
504505
expect(describeTopicResult.all()).andReturn(KafkaFuture.completedFuture(new HashMap<>()));
505506
replay(clusterManager, adminClient, describeTopicResult);
506507

@@ -512,7 +513,7 @@ public void getTopic_nonExistingTopic_returnsEmpty() throws Exception {
512513
@Test
513514
public void getLocalTopic_existingTopic_returnsTopic() throws Exception {
514515
expect(clusterManager.getLocalCluster()).andReturn(completedFuture(CLUSTER));
515-
expect(adminClient.describeTopics(anyObject())).andReturn(describeTopicResult);
516+
expect(adminClient.describeTopics(isA(Collection.class))).andReturn(describeTopicResult);
516517
expect(describeTopicResult.all())
517518
.andReturn(KafkaFuture.completedFuture(createTopicDescriptionMap(TOPIC_DESCRIPTION_1)));
518519
replay(clusterManager, adminClient, describeTopicResult);
@@ -525,7 +526,7 @@ public void getLocalTopic_existingTopic_returnsTopic() throws Exception {
525526
@Test
526527
public void getLocalTopic_nonExistingTopic_returnsEmpty() throws Exception {
527528
expect(clusterManager.getLocalCluster()).andReturn(completedFuture(CLUSTER));
528-
expect(adminClient.describeTopics(anyObject())).andReturn(describeTopicResult);
529+
expect(adminClient.describeTopics(isA(Collection.class))).andReturn(describeTopicResult);
529530
expect(describeTopicResult.all()).andReturn(KafkaFuture.completedFuture(new HashMap<>()));
530531
replay(clusterManager, adminClient, describeTopicResult);
531532

kafka-rest/src/test/java/io/confluent/kafkarest/integration/ClusterTestHarness.java

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public Properties overrideSchemaRegistryProps(Properties props) {
164164
@Before
165165
public void setUp() throws Exception {
166166
zookeeper = new EmbeddedZookeeper();
167+
zkConnect = String.format("127.0.0.1:%d", zookeeper.port());
167168
// start brokers concurrently
168169
startBrokersConcurrently(numBrokers);
169170

0 commit comments

Comments
 (0)