public ConnectorStateInfo connectorStatus(String connectorName) {
        ObjectMapper mapper = new ObjectMapper();
        String url = endpointForResource(String.format("connectors/%s/status", connectorName));
        Response response = requestGet(url);
        try {
            if (response.getStatus() < Response.Status.BAD_REQUEST.getStatusCode()) {
                return mapper.readerFor(ConnectorStateInfo.class)
                        .readValue(responseToString(response));
            }
        } catch (IOException e) {
            log.error("Could not read connector state from response: {}",
                    responseToString(response), e);
            throw new ConnectException("Could not not parse connector state", e);
        }
        throw new ConnectRestException(response.getStatus(),
                "Could not read connector state. Error response: " + responseToString(response));
    }
Get the status for a connector running in this cluster.

@param connectorName name of the connector
@return an instance of {@link ConnectorStateInfo} populated with state information of the connector and its tasks.
@throws ConnectRestException if the HTTP request to the REST API failed with a valid status code.
@throws ConnectException for any other error.
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedConnect.java