private void assertRequestTimesOut(String requestDescription, Executable request, String expectedTimeoutMessage) {
        // Artificially reduce the REST request timeout so that these don't take 90 seconds
        connect.requestTimeout(REDUCED_REST_REQUEST_TIMEOUT);
        ConnectRestException exception = assertThrows(
                ConnectRestException.class, request,
                "Should have failed to " + requestDescription
        );
        assertEquals(
                Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), exception.statusCode(),
                "Should have gotten 500 error from trying to " + requestDescription
        );
        assertTrue(
                exception.getMessage().contains("Request timed out"),
                "Should have gotten timeout message from trying to " + requestDescription
                        + "; instead, message was: " + exception.getMessage()
        );
        if (expectedTimeoutMessage != null) {
            assertTrue(
                    exception.getMessage().contains(expectedTimeoutMessage),
                    "Timeout error message '" + exception.getMessage() + "' does not match expected format"
            );
        }
        // Reset the REST request timeout so that other requests aren't impacted
        connect.resetRequestTimeout();
    }
Tests situations during which certain connector operations, such as start, validation,
configuration and others, take longer than expected.
connect/runtime/src/test/java/org/apache/kafka/connect/integration/BlockingConnectorTest.java