@Override
    public ElasticAgentPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
        String pluginId = descriptor.id();

        PluggableInstanceSettings pluggableInstanceSettings = null;
        if (!extension.supportsClusterProfiles(pluginId)) {
            pluggableInstanceSettings = getPluginSettingsAndView(descriptor, extension);
        }

        return new ElasticAgentPluginInfo(descriptor,
                elasticElasticAgentProfileSettings(pluginId),
                elasticClusterProfileSettings(pluginId),
                image(pluginId),
                pluggableInstanceSettings,
                capabilities(pluginId));
    }
@Test
    public void shouldGetCapabilitiesForAPlugin() {
        GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build();

        when(pluginManager.resolveExtensionVersion("plugin1", ELASTIC_AGENT_EXTENSION, SUPPORTED_VERSIONS)).thenReturn("2.0");
        Capabilities capabilities = new Capabilities(true);
        when(extension.getCapabilities(descriptor.id())).thenReturn(capabilities);

        ElasticAgentPluginInfo pluginInfo = new ElasticAgentPluginInfoBuilder(extension).pluginInfoFor(descriptor);

        assertThat(pluginInfo.getCapabilities(), is(capabilities));
    }