Browse Source

MINOR: reuse toConfigObject(Map) to generate Config (#8889)

Author: Chia-Ping Tsai <chia7712@gmail.com>
Reviewers: Randall Hauch <rhauch@gmail.com>, David Jacot <david.jacot@gmail.com>
pull/8893/head
Chia-Ping Tsai 4 years ago committed by GitHub
parent
commit
3b7c2ab6d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      clients/src/test/java/org/apache/kafka/clients/admin/MockAdminClient.java

5
clients/src/test/java/org/apache/kafka/clients/admin/MockAdminClient.java

@ -51,7 +51,6 @@ import java.util.List; @@ -51,7 +51,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
public class MockAdminClient extends AdminClient {
public static final String DEFAULT_CLUSTER_ID = "I4ZmrWqfT2e-upky_4fdPA";
@ -532,9 +531,7 @@ public class MockAdminClient extends AdminClient { @@ -532,9 +531,7 @@ public class MockAdminClient extends AdminClient {
if (topicMetadata != null && !topicMetadata.markedForDeletion) {
if (topicMetadata.fetchesRemainingUntilVisible > 0)
topicMetadata.fetchesRemainingUntilVisible = Math.max(0, topicMetadata.fetchesRemainingUntilVisible - 1);
else return new Config(topicMetadata.configs.entrySet().stream()
.map(entry -> new ConfigEntry(entry.getKey(), entry.getValue()))
.collect(Collectors.toList()));
else return toConfigObject(topicMetadata.configs);
}
throw new UnknownTopicOrPartitionException("Resource " + resource + " not found.");

Loading…
Cancel
Save