private boolean verifyConnectorHealthAndConfig(
        String connectorName,
        ConnectorHealth expectedHealth,
        Map<String, String> expectedConfig
    ) {
        ConnectClusterState clusterState =
            IntegrationTestRestExtension.instance.restPluginContext.clusterState();
        
        ConnectorHealth actualHealth = clusterState.connectorHealth(connectorName);
        if (actualHealth.tasksState().isEmpty()) {
            // Happens if the task has been started but its status has not yet been picked up from
            // the status topic by the worker.
            return false;
        }
        Map<String, String> actualConfig = clusterState.connectorConfig(connectorName);

        assertEquals(expectedConfig, actualConfig);
        assertEquals(expectedHealth, actualHealth);

        return true;
    }
A simple integration test to ensure that REST extensions are registered correctly.
connect/runtime/src/test/java/org/apache/kafka/connect/integration/RestExtensionIntegrationTest.java