public ConnectorOffsets connectorOffsets(String connectorName) {
        String url = endpointForResource(String.format("connectors/%s/offsets", connectorName));
        Response response = requestGet(url);
        ObjectMapper mapper = new ObjectMapper();

        try {
            if (response.getStatus() < Response.Status.BAD_REQUEST.getStatusCode()) {
                return mapper.readerFor(ConnectorOffsets.class).readValue(responseToString(response));
            }
        } catch (IOException e) {
            throw new ConnectException("Could not not parse connector offsets", e);
        }
        throw new ConnectRestException(response.getStatus(),
                "Could not fetch connector offsets. Error response: " + responseToString(response));
    }
Get the offsets for a connector via the <strong><em>GET /connectors/{connector}/offsets</em></strong> endpoint

@param connectorName name of the connector whose offsets are to be retrieved
@return the connector's offsets
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedConnect.java