### Question:
KafkaAdminClient implements Closeable { public void createTopic(String topic, int partitions, int replicationFactor) { createTopic(topic, partitions, replicationFactor, new Properties()); } KafkaAdminClient(Properties properties); Set<String> getTopics(); Set<TopicAndPartition> getPartitions(); Set<TopicAndPartition> getPartitions(String topic); Authorizer getAuthorizer(); Map<Resource, Set<Acl>> getAcls(); Map<Resource, Set<Acl>> getAcls(KafkaPrincipal principal); Set<Acl> getAcls(Resource resource); void addAcls(Set<Acl> acls, Resource resource); void removeAcls(Set<Acl> acls, Resource resource); void createTopic(String topic, int partitions, int replicationFactor); void createTopic(String topic, int partitions, int replicationFactor, Properties topicConfig); void deleteTopic(String topic); Properties getTopicConfig(String topic); void updateTopicConfig(String topic, Properties properties); int getTopicReplicationFactor(String topic); int getTopicPartitions(String topic); void addTopicPartitions(String topic, int partitions); AdminClient.ConsumerGroupSummary getConsumerGroupSummary(String consumerGroup); Collection<AdminClient.ConsumerSummary> getConsumerGroupSummaries(String consumerGroup); Map<TopicPartition, String> getConsumerGroupAssignments(String consumerGroup); @Override void close(); static final String ZOOKEEPER_SECURE; static final String DEFAULT_ZOOKEEPER_SECURE; static final String OPERATION_TIMEOUT_MS; static final String DEFAULT_OPERATION_TIMEOUT_MS; static final String OPERATION_SLEEP_MS; static final String DEFAULT_OPERATION_SLEEP_MS; }### Answer:
@Test(expected = IllegalArgumentException.class) public void createTopic_nullTopic() { client.createTopic(null, 1, 1); }
@Test(expected = IllegalArgumentException.class) public void createTopic_partitionsLessThanOne() { client.createTopic(topic, 0, 1); }
@Test(expected = IllegalArgumentException.class) public void createTopic_replicationFactorLessThanOne() { client.createTopic(topic, 1, 0); }
@Test(expected = IllegalArgumentException.class) public void createTopic_topicConfigIsNull() { client.createTopic(topic, 1, 1, null); }
@Test(expected = TopicExistsException.class) public void createTopic_topicExists() { client.createTopic(topic, 1, 1); client.createTopic(topic, 1, 1); }
@Test(expected = InvalidReplicationFactorException.class) public void createTopic_replicationFactorMoreThanAvailableBrokers() { client.createTopic(topic, 1, 2); }
@Test(expected = InvalidTopicException.class) public void createTopic_invalidTopicName() { client.createTopic("I'm not a valid topic!", 1, 1); }