Browse Source

MINOR: Simplify KafkaProducerTest (#8044)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ron Dagostino <rndgstn@gmail.com>
pull/8074/head
Kun Song 5 years ago committed by GitHub
parent
commit
87eaa5396d
  1. 8
      clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java

8
clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java

@ -103,19 +103,21 @@ public class KafkaProducerTest {
private String topic = "topic"; private String topic = "topic";
private Node host1 = new Node(0, "host1", 1000); private Node host1 = new Node(0, "host1", 1000);
private Collection<Node> nodes = Collections.singletonList(host1); private Collection<Node> nodes = Collections.singletonList(host1);
private final Cluster emptyCluster = new Cluster(null, nodes, private final Cluster emptyCluster = new Cluster(
null,
nodes,
Collections.emptySet(), Collections.emptySet(),
Collections.emptySet(), Collections.emptySet(),
Collections.emptySet()); Collections.emptySet());
private final Cluster onePartitionCluster = new Cluster( private final Cluster onePartitionCluster = new Cluster(
"dummy", "dummy",
Collections.singletonList(host1), nodes,
Collections.singletonList(new PartitionInfo(topic, 0, null, null, null)), Collections.singletonList(new PartitionInfo(topic, 0, null, null, null)),
Collections.emptySet(), Collections.emptySet(),
Collections.emptySet()); Collections.emptySet());
private final Cluster threePartitionCluster = new Cluster( private final Cluster threePartitionCluster = new Cluster(
"dummy", "dummy",
Collections.singletonList(host1), nodes,
Arrays.asList( Arrays.asList(
new PartitionInfo(topic, 0, null, null, null), new PartitionInfo(topic, 0, null, null, null),
new PartitionInfo(topic, 1, null, null, null), new PartitionInfo(topic, 1, null, null, null),

Loading…
Cancel
Save