@Override
    public synchronized void patchConnectorConfig(String connName, Map<String, String> configPatch, Callback<Created<ConnectorInfo>> callback) {
        try {
            ConnectorInfo connectorInfo = connectorInfo(connName);
            if (connectorInfo == null) {
                callback.onCompletion(new NotFoundException("Connector " + connName + " not found", null), null);
                return;
            }

            Map<String, String> patchedConfig = ConnectUtils.patchConfig(connectorInfo.config(), configPatch);
            validateConnectorConfig(patchedConfig, (error, configInfos) -> {
                if (error != null) {
                    callback.onCompletion(error, null);
                    return;
                }

                requestExecutorService.submit(
                        () -> putConnectorConfig(connName, patchedConfig, null, true, callback, configInfos)
                );
            });
        } catch (Throwable e) {
            callback.onCompletion(e, null);
        }
    }
@Test
    public void testPatchConnectorConfigNotFound() {
        initialize(false);
        Map<String, String> connConfigPatch = new HashMap<>();
        connConfigPatch.put("foo1", "baz1");

        Callback<Herder.Created<ConnectorInfo>> patchCallback = mock(Callback.class);
        herder.patchConnectorConfig(CONNECTOR_NAME, connConfigPatch, patchCallback);

        ArgumentCaptor<NotFoundException> exceptionCaptor = ArgumentCaptor.forClass(NotFoundException.class);
        verify(patchCallback).onCompletion(exceptionCaptor.capture(), isNull());
        assertEquals(exceptionCaptor.getValue().getMessage(), "Connector " + CONNECTOR_NAME + " not found");
    }