protected boolean checkConnectorDoesNotExist(String connectorName) {
        try {
            connect.connectorStatus(connectorName);
        } catch (ConnectRestException e) {
            return e.statusCode() == Response.Status.NOT_FOUND.getStatusCode();
        } catch (Exception e) {
            log.error("Could not check connector state info.", e);
            return false;
        }
        return false;
    }
Check whether a connector exists by querying the <strong><em>GET /connectors/{connector}/status</em></strong> endpoint

@param connectorName the connector name
@return true if the connector does not exist; false otherwise
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/ConnectAssertions.java