@Test public void shouldReturnFalseWhenSuppliedNullTopicDescription() { Cluster cluster = createCluster(1); try (MockKafkaAdminClientEnv env = new MockKafkaAdminClientEnv(cluster)) { env.kafkaClient().setNode(cluster.controller()); env.kafkaClient().setNodeApiVersions(NodeApiVersions.create()); env.kafkaClient().prepareMetadataUpdate(env.cluster(), Collections.<String>emptySet()); TopicAdmin admin = new TopicAdmin(null, env.adminClient()); boolean created = admin.createTopic(null); assertFalse(created); } }
public boolean createTopic(NewTopic topic) { if (topic == null) return false; Set<String> newTopicNames = createTopics(topic); return newTopicNames.contains(topic.name()); }
TopicAdmin implements AutoCloseable { public boolean createTopic(NewTopic topic) { if (topic == null) return false; Set<String> newTopicNames = createTopics(topic); return newTopicNames.contains(topic.name()); } }
TopicAdmin implements AutoCloseable { public boolean createTopic(NewTopic topic) { if (topic == null) return false; Set<String> newTopicNames = createTopics(topic); return newTopicNames.contains(topic.name()); } TopicAdmin(Map<String, Object> adminConfig);   TopicAdmin(Map<String, Object> adminConfig, AdminClient adminClient); }
TopicAdmin implements AutoCloseable { public boolean createTopic(NewTopic topic) { if (topic == null) return false; Set<String> newTopicNames = createTopics(topic); return newTopicNames.contains(topic.name()); } TopicAdmin(Map<String, Object> adminConfig);   TopicAdmin(Map<String, Object> adminConfig, AdminClient adminClient); static NewTopicBuilder defineTopic(String topicName); boolean createTopic(NewTopic topic); Set<String> createTopics(NewTopic... topics); @Override void close(); }
TopicAdmin implements AutoCloseable { public boolean createTopic(NewTopic topic) { if (topic == null) return false; Set<String> newTopicNames = createTopics(topic); return newTopicNames.contains(topic.name()); } TopicAdmin(Map<String, Object> adminConfig);   TopicAdmin(Map<String, Object> adminConfig, AdminClient adminClient); static NewTopicBuilder defineTopic(String topicName); boolean createTopic(NewTopic topic); Set<String> createTopics(NewTopic... topics); @Override void close();  }