public void createAgent(final String pluginId, String autoRegisterKey, String environment, Map<String, String> configuration, Map<String, String> clusterProfileConfiguration, JobIdentifier jobIdentifier) {
        PluginDescriptor plugin = findPlugin(pluginId);
        if (plugin != null) {
            LOGGER.debug("Processing create agent for plugin: {} with environment: {} with elastic agent configuration: {} in cluster: {}", pluginId, environment, configuration, clusterProfileConfiguration);
            extension.createAgent(pluginId, autoRegisterKey, environment, configuration, clusterProfileConfiguration, jobIdentifier);
            LOGGER.debug("Done processing create agent for plugin: {} with environment: {} with elastic agent configuration: {} in cluster: {}", pluginId, environment, configuration, clusterProfileConfiguration);
        } else {
            LOGGER.warn("Could not find plugin with id: {}", pluginId);
        }
    }
@Test
    public void shouldTalkToExtensionToCreateElasticAgent() {
        final Map<String, String> configuration = Map.of("GoServerURL", "foo");
        final Map<String, String> clusterConfiguration = Map.of("GoServerURL", "foo");
        final JobIdentifier jobIdentifier = new JobIdentifier();
        final String autoRegisterKey = "auto-register-key";
        final String environment = "test-env";

        elasticAgentPluginRegistry.createAgent(PLUGIN_ID, autoRegisterKey, environment, configuration, clusterConfiguration, jobIdentifier);

        verify(elasticAgentExtension, times(1)).createAgent(PLUGIN_ID, autoRegisterKey, environment, configuration, clusterConfiguration, jobIdentifier);
        verifyNoMoreInteractions(elasticAgentExtension);
    }