public void assertExactlyNumErrorsOnConnectorConfigValidation(String connectorClass, Map<String, String> connConfig,
        int numErrors, String detailMessage, long timeout) throws InterruptedException {
        try {
            waitForCondition(
                () -> checkValidationErrors(
                    connectorClass,
                    connConfig,
                    numErrors,
                    (actual, expected) -> actual == expected
                ).orElse(false),
                timeout,
                "Didn't meet the exact requested number of validation errors: " + numErrors);
        } catch (AssertionError e) {
            throw new AssertionError(detailMessage, e);
        }
    }
Assert that the required number of errors are produced by a connector config validation.

@param connectorClass the class of the connector to validate
@param connConfig     the intended configuration
@param numErrors      the number of errors expected
@param detailMessage  the assertion message
@param timeout        how long to retry for before throwing an exception

@throws AssertionError if the exact number of errors is not produced during config
validation before the timeout expires
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/ConnectAssertions.java