public void assertTopicSettings(String topicName, int replicas, int partitions, String detailMessage)
            throws InterruptedException {
        try {
            waitForCondition(
                () -> checkTopicSettings(
                    topicName,
                    replicas,
                    partitions
                ).orElse(false),
                VALIDATION_DURATION_MS,
                "Topic " + topicName + " does not exist or does not have exactly "
                        + partitions + " partitions or at least "
                        + replicas + " per partition");
        } catch (AssertionError e) {
            throw new AssertionError(detailMessage, e);
        }
    }
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