@Override
        public void register(ConnectRestExtensionContext restPluginContext) {
            instance = this;
            this.restPluginContext = restPluginContext;
            // Immediately request a list of connectors to confirm that the context and its fields
            // has been fully initialized and there is no risk of deadlock
            restPluginContext.clusterState().connectors();
            // Install a new REST resource that can be used to confirm that the extension has been
            // successfully registered
            restPluginContext.configurable().register(new IntegrationTestRestExtensionResource());
        }
A simple integration test to ensure that REST extensions are registered correctly.
connect/runtime/src/test/java/org/apache/kafka/connect/integration/RestExtensionIntegrationTest.java