protected Optional<Boolean> checkTopicSettings(String topicName, int replicas, int partitions) {
        try {
            Map<String, Optional<TopicDescription>> topics = connect.kafka().describeTopics(topicName);
            TopicDescription topicDesc = topics.get(topicName).orElse(null);
            boolean result = topicDesc != null
                    && topicDesc.name().equals(topicName)
                    && topicDesc.partitions().size() == partitions
                    && topicDesc.partitions().stream().allMatch(p -> p.replicas().size() >= replicas);
            return Optional.of(result);
        } catch (Exception e) {
            log.error("Failed to describe the topic: {}.", topicName, e);
            return Optional.empty();
        }
    }
Assert that the named topic is configured to have the specified replication factor and
number of partitions.

@param topicName  the name of the topic that is expected to exist
@param replicas   the replication factor
@param partitions the number of partitions
@param detailMessage the assertion message
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/ConnectAssertions.java