public String configureConnector(CreateConnectorRequest createConnectorRequest) {
        String url = endpointForResource("connectors");
        ObjectMapper objectMapper = new ObjectMapper();

        String requestBody;
        try {
            requestBody = objectMapper.writeValueAsString(createConnectorRequest);
        } catch (IOException e) {
            throw new ConnectException("Failed to serialize connector creation request: " + createConnectorRequest);
        }

        Response response = requestPost(url, requestBody, Collections.emptyMap());
        if (response.getStatus() < Response.Status.BAD_REQUEST.getStatusCode()) {
            return responseToString(response);
        } else {
            throw new ConnectRestException(
                response.getStatus(),
                "Could not execute 'POST /connectors' request. Error response: " + responseToString(response)
            );
        }
    }
Configure a new connector using the <strong><em>POST /connectors</em></strong> endpoint. If the connector already exists, a
{@link ConnectRestException} will be thrown.

@param createConnectorRequest the connector creation request
@throws ConnectRestException if the REST API returns error status
@throws ConnectException if the request could not be sent
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedConnect.java