@Override
    public void start(Map<String, String> config) {
        this.config = config;

        if (CONNECTOR_FAILURE.equals(config.get(MOCK_MODE_KEY))) {
            // Schedule this connector to raise an exception after some delay

            String delayMsString = config.get(DELAY_MS_KEY);
            long delayMs = DEFAULT_FAILURE_DELAY_MS;
            if (delayMsString != null)
                delayMs = Long.parseLong(delayMsString);

            log.debug("Started MockConnector with failure delay of {} ms", delayMs);
            executor = Executors.newSingleThreadScheduledExecutor();
            executor.schedule(() -> {
                log.debug("Triggering connector failure");
                context.raiseError(new RuntimeException());
            }, delayMs, TimeUnit.MILLISECONDS);
        }
    }
This connector provides support for mocking certain connector behaviors. For example,
this can be used to simulate connector or task failures. It works by passing a "mock mode"
through configuration from the system test. New mock behavior can be implemented either
in the connector or in the task by providing a new mode implementation.
<p>
At the moment, this connector only supports a single task and shares configuration between
the connector and its tasks.

@see MockSinkConnector
@see MockSourceConnector
connect/test-plugins/src/main/java/org/apache/kafka/connect/tools/MockConnector.java