public String endpointForResourceNotRunningConnector(String resource, String connectorName) {
        ConnectorStateInfo info = connectorStatus(connectorName);
        Set<String> activeWorkerUrls = new HashSet<>();
        activeWorkerUrls.add(String.format("http://%s/", info.connector().workerId()));
        info.tasks().forEach(t -> activeWorkerUrls.add(String.format("http://%s/", t.workerId())));
        String url = workers().stream()
                .map(WorkerHandle::url)
                .filter(Objects::nonNull)
                .filter(workerUrl -> !activeWorkerUrls.contains(workerUrl.toString()))
                .findFirst()
                .orElseThrow(() -> new ConnectException(
                        String.format("Connect workers have not been provisioned or no free worker found that is not running this connector(%s) or its tasks", connectorName)))
                .toString();
        return url + resource;
    }
Get the full URL of the endpoint that corresponds to the given REST resource using a worker
that is not running any tasks or connector instance for the connectorName provided in the arguments

@param resource the resource under the worker's admin endpoint
@param connectorName the name of the connector
@return the admin endpoint URL
@throws ConnectException if no REST endpoint is available
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedConnect.java