19
19
import static java .util .Collections .singletonList ;
20
20
import static java .util .Collections .singletonMap ;
21
21
import static java .util .concurrent .CompletableFuture .completedFuture ;
22
- import static org .easymock .EasyMock .anyObject ;
23
22
import static org .easymock .EasyMock .expect ;
23
+ import static org .easymock .EasyMock .isA ;
24
24
import static org .easymock .EasyMock .replay ;
25
25
import static org .easymock .EasyMock .verify ;
26
26
import static org .junit .Assert .assertEquals ;
36
36
import io .confluent .kafkarest .entities .Topic ;
37
37
import java .util .ArrayList ;
38
38
import java .util .Arrays ;
39
+ import java .util .Collection ;
39
40
import java .util .Collections ;
40
41
import java .util .HashMap ;
41
42
import java .util .HashSet ;
@@ -411,7 +412,7 @@ public void listTopics_existingCluster_returnsTopics() throws Exception {
411
412
expect (clusterManager .getCluster (CLUSTER_ID )).andReturn (completedFuture (Optional .of (CLUSTER )));
412
413
expect (adminClient .listTopics ()).andReturn (listTopicsResult );
413
414
expect (listTopicsResult .listings ()).andReturn (KafkaFuture .completedFuture (TOPIC_LISTINGS ));
414
- expect (adminClient .describeTopics (anyObject ( ))).andReturn (describeTopicResult );
415
+ expect (adminClient .describeTopics (isA ( Collection . class ))).andReturn (describeTopicResult );
415
416
expect (describeTopicResult .all ())
416
417
.andReturn (
417
418
KafkaFuture .completedFuture (
@@ -444,7 +445,7 @@ public void listLocalTopics_returnsTopics() throws Exception {
444
445
expect (clusterManager .getLocalCluster ()).andReturn (completedFuture (CLUSTER ));
445
446
expect (adminClient .listTopics ()).andReturn (listTopicsResult );
446
447
expect (listTopicsResult .listings ()).andReturn (KafkaFuture .completedFuture (TOPIC_LISTINGS ));
447
- expect (adminClient .describeTopics (anyObject ( ))).andReturn (describeTopicResult );
448
+ expect (adminClient .describeTopics (isA ( Collection . class ))).andReturn (describeTopicResult );
448
449
expect (describeTopicResult .all ())
449
450
.andReturn (
450
451
KafkaFuture .completedFuture (
@@ -473,7 +474,7 @@ public void listTopic_nonExistingCluster_throwsNotFoundException() throws Except
473
474
@ Test
474
475
public void getTopic_existingTopic_returnsTopic () throws Exception {
475
476
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 );
477
478
expect (describeTopicResult .all ())
478
479
.andReturn (KafkaFuture .completedFuture (createTopicDescriptionMap (TOPIC_DESCRIPTION_1 )));
479
480
replay (clusterManager , adminClient , describeTopicResult );
@@ -486,7 +487,7 @@ public void getTopic_existingTopic_returnsTopic() throws Exception {
486
487
@ Test
487
488
public void getTopic_nonExistingCluster_throwsNotFoundException () throws Exception {
488
489
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 );
490
491
replay (clusterManager );
491
492
492
493
try {
@@ -500,7 +501,7 @@ public void getTopic_nonExistingCluster_throwsNotFoundException() throws Excepti
500
501
@ Test
501
502
public void getTopic_nonExistingTopic_returnsEmpty () throws Exception {
502
503
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 );
504
505
expect (describeTopicResult .all ()).andReturn (KafkaFuture .completedFuture (new HashMap <>()));
505
506
replay (clusterManager , adminClient , describeTopicResult );
506
507
@@ -512,7 +513,7 @@ public void getTopic_nonExistingTopic_returnsEmpty() throws Exception {
512
513
@ Test
513
514
public void getLocalTopic_existingTopic_returnsTopic () throws Exception {
514
515
expect (clusterManager .getLocalCluster ()).andReturn (completedFuture (CLUSTER ));
515
- expect (adminClient .describeTopics (anyObject ( ))).andReturn (describeTopicResult );
516
+ expect (adminClient .describeTopics (isA ( Collection . class ))).andReturn (describeTopicResult );
516
517
expect (describeTopicResult .all ())
517
518
.andReturn (KafkaFuture .completedFuture (createTopicDescriptionMap (TOPIC_DESCRIPTION_1 )));
518
519
replay (clusterManager , adminClient , describeTopicResult );
@@ -525,7 +526,7 @@ public void getLocalTopic_existingTopic_returnsTopic() throws Exception {
525
526
@ Test
526
527
public void getLocalTopic_nonExistingTopic_returnsEmpty () throws Exception {
527
528
expect (clusterManager .getLocalCluster ()).andReturn (completedFuture (CLUSTER ));
528
- expect (adminClient .describeTopics (anyObject ( ))).andReturn (describeTopicResult );
529
+ expect (adminClient .describeTopics (isA ( Collection . class ))).andReturn (describeTopicResult );
529
530
expect (describeTopicResult .all ()).andReturn (KafkaFuture .completedFuture (new HashMap <>()));
530
531
replay (clusterManager , adminClient , describeTopicResult );
531
532
0 commit comments